home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / amigaunits / intuition.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-01-01  |  191.3 KB  |  5,730 lines

  1. {
  2.     This file is part of the Free Pascal run time library.
  3.  
  4.     A file in Amiga system run time library.
  5.     Copyright (c) 1998-2000 by Nils Sjoholm
  6.     member of the Amiga RTL development team.
  7.  
  8.     See the file COPYING.FPC, included in this distribution,
  9.     for details about the copyright.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14.  
  15.  **********************************************************************}
  16.  
  17.  
  18. {
  19.    History:
  20.    Changed tNewWindow.MaxHeigth and tNewWindow.MaxWidth
  21.    from Word to Integer.
  22.    
  23.    30 May 2000.
  24.  
  25.    Added overlay functions for Pchar->Strings, functions
  26.    and procedures.
  27.    
  28.    14 Jul 2000.
  29.  
  30.    nils.sjoholm@mailbox.swipnet.se Nils Sjoholm
  31.  
  32. }
  33.  
  34. unit intuition;
  35.  
  36. INTERFACE
  37.  
  38. {$I amigaoverlays.inc}
  39.  
  40. uses exec, graphics, utility, inputevent, timer, layers;
  41.  
  42. {
  43.  * NOTE:  intuition/iobsolete.h is included at the END of this file!
  44.  }
  45.  
  46. { ======================================================================== }
  47. { === IntuiText ========================================================== }
  48. { ================================= ======================================= }
  49. { IntuiText is a series of strings that start with a screen location
  50.  *  (always relative to the upper-left corner of something) and then the
  51.  *  text of the string.  The text is null-terminated.
  52.  }
  53. Type
  54.     pIntuiText = ^tIntuiText;
  55.     tIntuiText = record
  56.         FrontPen,
  57.         BackPen         : Byte;         { the pen numbers for the rendering }
  58.         DrawMode        : Byte;         { the mode for rendering the text }
  59.         LeftEdge        : Integer;        { relative start location for the text }
  60.         TopEdge         : Integer;        { relative start location for the text }
  61.         ITextFont       : pTextAttr;  { if NULL, you accept the default }
  62.         IText           : STRPTR;       { pointer to null-terminated text }
  63.         NextText        : pIntuiText;   { continuation to TxWrite another text }
  64.     end;
  65.  
  66.  
  67.  
  68. { ======================================================================== }
  69. { === Border ============================================================= }
  70. { ======================================================================== }
  71. { Data type Border, used for drawing a series of lines which is intended for
  72.  *  use as a border drawing, but which may, in fact, be used to render any
  73.  *  arbitrary vector shape.
  74.  *  The routine DrawBorder sets up the RastPort with the appropriate
  75.  *  variables, then does a Move to the first coordinate, then does Draws
  76.  *  to the subsequent coordinates.
  77.  *  After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  78.  *  recursively
  79.  }
  80. Type
  81.     pBorder = ^tBorder;
  82.     tBorder = record
  83.         LeftEdge,
  84.         TopEdge         : Integer;        { initial offsets from the origin }
  85.         FrontPen,
  86.         BackPen         : Byte;         { pens numbers for rendering }
  87.         DrawMode        : Byte;         { mode for rendering }
  88.         Count           : Shortint;         { number of XY pairs }
  89.         XY              : Pointer;      { vector coordinate pairs rel to LeftTop}
  90.         NextBorder      : pBorder;      { pointer to any other Border too }
  91.     end;
  92.  
  93. { ======================================================================== }
  94. { === MenuItem =========================================================== }
  95. { ======================================================================== }
  96.  
  97. Type
  98.  
  99.     pMenuItem = ^tMenuItem;
  100.     tMenuItem = record
  101.         NextItem        : pMenuItem;    { pointer to next in chained list }
  102.         LeftEdge,
  103.         TopEdge         : Integer;        { position of the select box }
  104.         Width,
  105.         Height          : Integer;        { dimensions of the select box }
  106.         Flags           : Word;        { see the defines below }
  107.  
  108.         MutualExclude   : Longint;      { set bits mean this item excludes that }
  109.  
  110.         ItemFill        : Pointer;      { points to Image, IntuiText, or NULL }
  111.  
  112.     { when this item is pointed to by the cursor and the items highlight
  113.      *  mode HIGHIMAGE is selected, this alternate image will be displayed
  114.      }
  115.  
  116.         SelectFill      : Pointer;      { points to Image, IntuiText, or NULL }
  117.  
  118.         Command         : Char;         { only if appliprog sets the COMMSEQ flag }
  119.  
  120.         SubItem         : pMenuItem;    { if non-zero, DrawMenu shows "->" }
  121.  
  122.     { The NextSelect field represents the menu number of next selected
  123.      *  item (when user has drag-selected several items)
  124.      }
  125.  
  126.         NextSelect      : Word;
  127.     end;
  128.  
  129.  
  130. Const
  131.  
  132. { FLAGS SET BY THE APPLIPROG }
  133.     CHECKIT     = $0001;        { whether to check this item if selected }
  134.     ITEMTEXT    = $0002;        { set if textual, clear if graphical item }
  135.     COMMSEQ     = $0004;        { set if there's an command sequence }
  136.     MENUTOGGLE  = $0008;        { set to toggle the check of a menu item }
  137.     ITEMENABLED = $0010;        { set if this item is enabled }
  138.  
  139. { these are the SPECIAL HIGHLIGHT FLAG state meanings }
  140.     HIGHFLAGS   = $00C0;        { see definitions below for these bits }
  141.     HIGHIMAGE   = $0000;        { use the user's "select image" }
  142.     HIGHCOMP    = $0040;        { highlight by complementing the selectbox }
  143.     HIGHBOX     = $0080;        { highlight by "boxing" the selectbox }
  144.     HIGHNONE    = $00C0;        { don't highlight }
  145.  
  146. { FLAGS SET BY BOTH APPLIPROG AND INTUITION }
  147.     CHECKED     = $0100;        { if CHECKIT, then set this when selected }
  148.  
  149. { FLAGS SET BY INTUITION }
  150.     ISDRAWN     = $1000;        { this item's subs are currently drawn }
  151.     HIGHITEM    = $2000;        { this item is currently highlighted }
  152.     MENUTOGGLED = $4000;        { this item was already toggled }
  153.  
  154.  
  155. { ======================================================================== }
  156. { === Menu =============================================================== }
  157. { ======================================================================== }
  158. Type
  159.  
  160.     pMenu = ^tMenu;
  161.     tMenu = record
  162.         NextMenu        : pMenu;        { same level }
  163.         LeftEdge,
  164.         TopEdge         : Integer;        { position of the select box }
  165.         Width,
  166.         Height          : Integer;        { dimensions of the select box }
  167.         Flags           : Word;        { see flag definitions below }
  168.         MenuName        : STRPTR;       { text for this Menu Header }
  169.         FirstItem       : pMenuItem;  { pointer to first in chain }
  170.  
  171.     { these mysteriously-named variables are for internal use only }
  172.  
  173.         JazzX,
  174.         JazzY,
  175.         BeatX,
  176.         BeatY           : Integer;
  177.     end;
  178.  
  179. CONST
  180. { FLAGS SET BY BOTH THE APPLIPROG AND INTUITION }
  181.     MENUENABLED = $0001;        { whether or not this menu is enabled }
  182.  
  183. { FLAGS SET BY INTUITION }
  184.     MIDRAWN     = $0100;        { this menu's items are currently drawn }
  185.  
  186.  
  187.  
  188.  
  189. { ======================================================================== }
  190. { === Gadget ============================================================= }
  191. { ======================================================================== }
  192.  
  193. Type
  194.  
  195.     pGadget = ^tGadget;
  196.     tGadget = record
  197.         NextGadget      : pGadget;      { next gadget in the list }
  198.  
  199.         LeftEdge,
  200.         TopEdge         : Integer;        { "hit box" of gadget }
  201.         Width,
  202.         Height          : Integer;        { "hit box" of gadget }
  203.  
  204.         Flags           : Word;        { see below for list of defines }
  205.  
  206.         Activation      : Word;        { see below for list of defines }
  207.  
  208.         GadgetType      : Word;        { see below for defines }
  209.  
  210.     { appliprog can specify that the Gadget be rendered as either as Border
  211.      * or an Image.  This variable points to which (or equals NULL if there's
  212.      * nothing to be rendered about this Gadget)
  213.      }
  214.  
  215.         GadgetRender    : Pointer;
  216.  
  217.     { appliprog can specify "highlighted" imagery rather than algorithmic
  218.      * this can point to either Border or Image data
  219.      }
  220.  
  221.         SelectRender    : Pointer;
  222.  
  223.         GadgetText      : pIntuiText; { text for this gadget }
  224.  
  225.     { by using the MutualExclude word, the appliprog can describe
  226.      * which gadgets mutually-exclude which other ones.  The bits
  227.      * in MutualExclude correspond to the gadgets in object containing
  228.      * the gadget list.  If this gadget is selected and a bit is set
  229.      * in this gadget's MutualExclude and the gadget corresponding to
  230.      * that bit is currently selected (e.g. bit 2 set and gadget 2
  231.      * is currently selected) that gadget must be unselected.
  232.      * Intuition does the visual unselecting (with checkmarks) and
  233.      * leaves it up to the program to unselect internally
  234.      }
  235.  
  236.         MutualExclude   : Longint;      { set bits mean this gadget excludes that gadget }
  237.  
  238.     { pointer to a structure of special data required by Proportional,
  239.      * String and Longint Gadgets
  240.      }
  241.  
  242.         SpecialInfo     : Pointer;
  243.  
  244.         GadgetID        : Word;        { user-definable ID field }
  245.         UserData        : Pointer;      { ptr to general purpose User data (ignored by In) }
  246.     end;
  247.  
  248.  pExtGadget = ^tExtGadget;
  249.  tExtGadget = record
  250.     { The first fields match struct Gadget exactly }
  251.     NextGadget     : pExtGadget;  { Matches struct Gadget }
  252.     LeftEdge, TopEdge,            { Matches struct Gadget }
  253.     Width, Height  : Integer;     { Matches struct Gadget }
  254.     Flags,                        { Matches struct Gadget }
  255.     Activation,                   { Matches struct Gadget }
  256.     GadgetType     : WORD;        { Matches struct Gadget }
  257.     GadgetRender,                 { Matches struct Gadget }
  258.     SelectRender   : Pointer;     { Matches struct Gadget }
  259.     GadgetText     : pIntuiText;  { Matches struct Gadget }
  260.     MutualExclude  : Longint;     { Matches struct Gadget }
  261.     SpecialInfo    : Pointer;     { Matches struct Gadget }
  262.     GadgetID       : WORD;        { Matches struct Gadget }
  263.     UserData       : Pointer;     { Matches struct Gadget }
  264.  
  265.     { These fields only exist under V39 and only if GFLG_EXTENDED is set }
  266.     MoreFlags      : ULONG;     { see GMORE_ flags below }
  267.     BoundsLeftEdge,             { Bounding extent for gadget, valid   }
  268.     BoundsTopEdge,              { only if GMORE_BOUNDS is set.  The   }
  269.     BoundsWidth,                { GFLG_RELxxx flags affect these      }
  270.     BoundsHeight   : Integer;      { coordinates as well.        }
  271.  end;
  272.  
  273.  
  274. CONST
  275. { --- Gadget.Flags values      --- }
  276. { combinations in these bits describe the highlight technique to be used }
  277.  GFLG_GADGHIGHBITS  = $0003;
  278.  GFLG_GADGHCOMP     = $0000;  { Complement the select box }
  279.  GFLG_GADGHBOX      = $0001;  { Draw a box around the image }
  280.  GFLG_GADGHIMAGE    = $0002;  { Blast in this alternate image }
  281.  GFLG_GADGHNONE     = $0003;  { don't highlight }
  282.  
  283.  GFLG_GADGIMAGE     = $0004;  { set IF GadgetRender AND SelectRender
  284.                                    * point to an Image structure, clear
  285.                                    * if they point to Border structures
  286.                                    }
  287.  
  288. { combinations in these next two bits specify to which corner the gadget's
  289.  *  Left & Top coordinates are relative.  If relative to Top/Left,
  290.  *  these are "normal" coordinates (everything is relative to something in
  291.  *  this universe).
  292.  *
  293.  * Gadget positions and dimensions are relative to the window or
  294.  * requester which contains the gadget
  295.  }
  296.  GFLG_RELBOTTOM   = $0008;  { vert. pos. is relative to bottom edge }
  297.  GFLG_RELRIGHT    = $0010;  { horiz. pos. is relative to right edge }
  298.  GFLG_RELWIDTH    = $0020;  { width is relative to req/window    }
  299.  GFLG_RELHEIGHT   = $0040;  { height is relative to req/window   }
  300.  
  301. { New for V39: GFLG_RELSPECIAL allows custom gadget implementors to
  302.  * make gadgets whose position and size depend in an arbitrary way
  303.  * on their window's dimensions.  The GM_LAYOUT method will be invoked
  304.  * for such a gadget (or any other GREL_xxx gadget) at suitable times,
  305.  * such as when the window opens or the window's size changes.
  306.  }
  307.  GFLG_RELSPECIAL  = $4000;  { custom gadget has special relativity.
  308.                                    * Gadget box values are absolutes, but
  309.                                    * can be changed via the GM_LAYOUT method.
  310.                                    }
  311.  
  312.  GFLG_SELECTED    = $0080;  { you may initialize AND look at this        }
  313.  
  314. { the GFLG_DISABLED flag is initialized by you and later set by Intuition
  315.  * according to your calls to On/OffGadget().  It specifies whether or not
  316.  * this Gadget is currently disabled from being selected
  317.  }
  318.  GFLG_DISABLED    = $0100;
  319.  
  320. { These flags specify the type of text field that Gadget.GadgetText
  321.  * points to.  In all normal (pre-V36) gadgets which you initialize
  322.  * this field should always be zero.  Some types of gadget objects
  323.  * created from classes will use these fields to keep track of
  324.  * types of labels/contents that different from IntuiText, but are
  325.  * stashed in GadgetText.
  326.  }
  327.  
  328.  GFLG_LABELMASK   = $3000;
  329.  GFLG_LABELITEXT  = $0000;  { GadgetText points to IntuiText     }
  330.  GFLG_LABELSTRING = $1000;  { GadgetText points to (UBYTE *)     }
  331.  GFLG_LABELIMAGE  = $2000;  { GadgetText points to Image (object)        }
  332.  
  333. { New for V37: GFLG_TABCYCLE }
  334.  GFLG_TABCYCLE    = $0200;  { (string OR custom) gadget participates in
  335.                                    * cycling activation with Tab or Shift-Tab
  336.                                    }
  337. { New for V37: GFLG_STRINGEXTEND.  We discovered that V34 doesn't properly
  338.  * ignore the value we had chosen for the Gadget->Activation flag
  339.  * GACT_STRINGEXTEND.  NEVER SET THAT FLAG WHEN RUNNING UNDER V34.
  340.  * The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
  341.  * safe under V34, and equivalent to GACT_STRINGEXTEND under V37.
  342.  * (Note that the two flags are not numerically equal)
  343.  }
  344.  GFLG_STRINGEXTEND = $0400;  { this String Gadget has StringExtend        }
  345.  
  346. { New for V39: GFLG_IMAGEDISABLE.  This flag is automatically set if
  347.  * the custom image of this gadget knows how to do disabled rendering
  348.  * (more specifically, if its IA_SupportsDisable attribute is TRUE).
  349.  * Intuition uses this to defer the ghosting to the image-class,
  350.  * instead of doing it itself (the old compatible way).
  351.  * Do not set this flag yourself - Intuition will do it for you.
  352.  }
  353.  
  354.  GFLG_IMAGEDISABLE = $0800;  { Gadget's image knows how to do disabled
  355.                                    * rendering
  356.                                    }
  357.  
  358. { New for V39:  If set, this bit means that the Gadget is actually
  359.  * a struct ExtGadget, with new fields and flags.  All V39 boopsi
  360.  * gadgets are ExtGadgets.  Never ever attempt to read the extended
  361.  * fields of a gadget if this flag is not set.
  362.  }
  363.  GFLG_EXTENDED    = $8000;  { Gadget is extended }
  364.  
  365. { ---  Gadget.Activation flag values   --- }
  366. { Set GACT_RELVERIFY if you want to verify that the pointer was still over
  367.  * the gadget when the select button was released.  Will cause
  368.  * an IDCMP_GADGETUP message to be sent if so.
  369.  }
  370.  GACT_RELVERIFY    = $0001;
  371.  
  372. { the flag GACT_IMMEDIATE, when set, informs the caller that the gadget
  373.  *  was activated when it was activated.  This flag works in conjunction with
  374.  *  the GACT_RELVERIFY flag
  375.  }
  376.  GACT_IMMEDIATE    = $0002;
  377.  
  378. { the flag GACT_ENDGADGET, when set, tells the system that this gadget,
  379.  * when selected, causes the Requester to be ended.  Requesters
  380.  * that are ended are erased and unlinked from the system.
  381.  }
  382.  GACT_ENDGADGET    = $0004;
  383.  
  384. { the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive
  385.  * reports on mouse movements while this gadget is active.
  386.  * You probably want to set the GACT_IMMEDIATE flag when using
  387.  * GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
  388.  * learning why Intuition is suddenly sending you a stream of mouse
  389.  * movement events.  If you don't set GACT_RELVERIFY, you'll get at
  390.  * least one Mouse Position event.
  391.  }
  392.  GACT_FOLLOWMOUSE = $0008;
  393.  
  394. { if any of the BORDER flags are set in a Gadget that's included in the
  395.  * Gadget list when a Window is opened, the corresponding Border will
  396.  * be adjusted to make room for the Gadget
  397.  }
  398.  GACT_RIGHTBORDER = $0010;
  399.  GACT_LEFTBORDER  = $0020;
  400.  GACT_TOPBORDER   = $0040;
  401.  GACT_BOTTOMBORDER= $0080;
  402.  GACT_BORDERSNIFF = $8000;  { neither set nor rely on this bit   }
  403.  
  404.  GACT_TOGGLESELECT= $0100;  { this bit for toggle-select mode }
  405.  GACT_BOOLEXTEND  = $2000;  { this Boolean Gadget has a BoolInfo }
  406.  
  407. { should properly be in StringInfo, but aren't }
  408.  GACT_STRINGLEFT  = $0000;  { NOTE WELL: that this has value zero        }
  409.  GACT_STRINGCENTER= $0200;
  410.  GACT_STRINGRIGHT = $0400;
  411.  GACT_LONGINT     = $0800;  { this String Gadget is for Long Ints        }
  412.  GACT_ALTKEYMAP   = $1000;  { this String has an alternate keymap        }
  413.  GACT_STRINGEXTEND= $2000;  { this String Gadget has StringExtend        }
  414.                                   { NOTE: NEVER SET GACT_STRINGEXTEND IF YOU
  415.                                    * ARE RUNNING ON LESS THAN V36!  SEE
  416.                                    * GFLG_STRINGEXTEND (ABOVE) INSTEAD
  417.                                    }
  418.  
  419.  GACT_ACTIVEGADGET = $4000;  { this gadget is "active".  This flag
  420.                                    * is maintained by Intuition, and you
  421.                                    * cannot count on its value persisting
  422.                                    * while you do something on your program's
  423.                                    * task.  It can only be trusted by
  424.                                    * people implementing custom gadgets
  425.                                    }
  426.  
  427. { note $8000 is used above (GACT_BORDERSNIFF);
  428.  * all Activation flags defined }
  429.  
  430. { --- GADGET TYPES ------------------------------------------------------- }
  431. { These are the Gadget Type definitions for the variable GadgetType
  432.  * gadget number type MUST start from one.  NO TYPES OF ZERO ALLOWED.
  433.  * first comes the mask for Gadget flags reserved for Gadget typing
  434.  }
  435.  GTYP_GADGETTYPE = $FC00;  { all Gadget Global Type flags (padded) }
  436.  GTYP_SYSGADGET  = $8000;  { 1 = Allocated by the system, 0 = by app. }
  437.  GTYP_SCRGADGET  = $4000;  { 1 = ScreenGadget, 0 = WindowGadget }
  438.  GTYP_GZZGADGET  = $2000;  { 1 = for WFLG_GIMMEZEROZERO borders }
  439.  GTYP_REQGADGET  = $1000;  { 1 = this is a Requester Gadget }
  440. { system gadgets }
  441.  GTYP_SIZING     = $0010;
  442.  GTYP_WDRAGGING  = $0020;
  443.  GTYP_SDRAGGING  = $0030;
  444.  GTYP_WUPFRONT   = $0040;
  445.  GTYP_SUPFRONT   = $0050;
  446.  GTYP_WDOWNBACK  = $0060;
  447.  GTYP_SDOWNBACK  = $0070;
  448.  GTYP_CLOSE      = $0080;
  449. { application gadgets }
  450.  GTYP_BOOLGADGET = $0001;
  451.  GTYP_GADGET0002 = $0002;
  452.  GTYP_PROPGADGET = $0003;
  453.  GTYP_STRGADGET  = $0004;
  454.  GTYP_CUSTOMGADGET    =   $0005;
  455.  
  456.  
  457. {* GTYP_GTYPEMASK is a mask you can apply to tell what class
  458.  * of gadget this is.  The possible classes follow.
  459.  *}
  460.  GTYP_GTYPEMASK        =  $0007;
  461.  
  462. { This bit in GadgetType is reserved for undocumented internal use
  463.  * by the Gadget Toolkit, and cannot be used nor relied on by
  464.  * applications:        $0100;
  465.  }
  466.  
  467. { New for V39.  Gadgets which have the GFLG_EXTENDED flag set are
  468.  * actually ExtGadgets, which have more flags.  The GMORE_xxx
  469.  * identifiers describe those flags.  For GMORE_SCROLLRASTER, see
  470.  * important information in the ScrollWindowRaster() autodoc.
  471.  * NB: GMORE_SCROLLRASTER must be set before the gadget is
  472.  * added to a window.
  473.  }
  474.  GMORE_BOUNDS       = $00000001; { ExtGadget has valid Bounds }
  475.  GMORE_GADGETHELP   = $00000002; { This gadget responds to gadget help }
  476.  GMORE_SCROLLRASTER = $00000004; { This (custom) gadget uses ScrollRaster }
  477.  
  478. { ======================================================================== }
  479. { === BoolInfo======================================================= }
  480. { ======================================================================== }
  481. { This is the special data needed by an Extended Boolean Gadget
  482.  * Typically this structure will be pointed to by the Gadget field SpecialInfo
  483.  }
  484. Type
  485.     pBoolInfo = ^tBoolInfo;
  486.     tBoolInfo = record
  487.         Flags   : Word;        { defined below }
  488.         Mask    : Pointer; { bit mask for highlighting and selecting
  489.                          * mask must follow the same rules as an Image
  490.                          * plane.  It's width and height are determined
  491.                          * by the width and height of the gadget's
  492.                          * select box. (i.e. Gadget.Width and .Height).
  493.                          }
  494.         Reserved : ULONG;     { set to 0      }
  495.     end;
  496.  
  497. Const
  498.  
  499. { set BoolInfo.Flags to this flag bit.
  500.  * in the future, additional bits might mean more stuff hanging
  501.  * off of BoolInfo.Reserved.
  502. }
  503.     BOOLMASK    = $0001;        { extension is for masked gadget }
  504.  
  505. { ======================================================================== }
  506. { === PropInfo =========================================================== }
  507. { ======================================================================== }
  508. { this is the special data required by the proportional Gadget
  509.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  510.  }
  511.  
  512. Type
  513.  
  514.     pPropInfo = ^tPropInfo;
  515.     tPropInfo = record
  516.         Flags   : Word;        { general purpose flag bits (see defines below) }
  517.  
  518.     { You initialize the Pot variables before the Gadget is added to
  519.      * the system.  Then you can look here for the current settings
  520.      * any time, even while User is playing with this Gadget.  To
  521.      * adjust these after the Gadget is added to the System, use
  522.      * ModifyProp();  The Pots are the actual proportional settings,
  523.      * where a value of zero means zero and a value of MAXPOT means
  524.      * that the Gadget is set to its maximum setting.
  525.      }
  526.  
  527.         HorizPot        : WORD; { 16-bit FixedPoint horizontal quantity percentage }
  528.         VertPot         : WORD; { 16-bit FixedPoint vertical quantity percentage }
  529.  
  530.     { the 16-bit FixedPoint Body variables describe what percentage of
  531.      * the entire body of stuff referred to by this Gadget is actually
  532.      * shown at one time.  This is used with the AUTOKNOB routines,
  533.      * to adjust the size of the AUTOKNOB according to how much of
  534.      * the data can be seen.  This is also used to decide how far
  535.      * to advance the Pots when User hits the Container of the Gadget.
  536.      * For instance, if you were controlling the display of a 5-line
  537.      * Window of text with this Gadget, and there was a total of 15
  538.      * lines that could be displayed, you would set the VertBody value to
  539.      *     (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  540.      * Therefore, the AUTOKNOB would fill 1/3 of the container, and
  541.      * if User hits the Cotainer outside of the knob, the pot would
  542.      * advance 1/3 (plus or minus) If there's no body to show, or
  543.      * the total amount of displayable info is less than the display area,
  544.      * set the Body variables to the MAX.  To adjust these after the
  545.      * Gadget is added to the System, use ModifyProp();
  546.      }
  547.  
  548.         HorizBody       : Word;        { horizontal Body }
  549.         VertBody        : Word;        { vertical Body }
  550.  
  551.     { these are the variables that Intuition sets and maintains }
  552.  
  553.         CWidth          : Word;        { Container width (with any relativity absoluted) }
  554.         CHeight         : Word;        { Container height (with any relativity absoluted) }
  555.         HPotRes,
  556.         VPotRes         : Word;        { pot increments }
  557.         LeftBorder      : Word;        { Container borders }
  558.         TopBorder       : Word;        { Container borders }
  559.     end;
  560.  
  561. CONST
  562. { --- FLAG BITS ---------------------------------------------------------- }
  563.  AUTOKNOB     =   $0001;  { this flag sez:  gimme that old auto-knob }
  564. { NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  565.  * you are currently limited to using a single Image of your own
  566.  * design: Intuition won't handle a linked list of images as
  567.  * a proportional gadget knob.
  568.  }
  569.  
  570.  FREEHORIZ     =  $0002;  { IF set, the knob can move horizontally }
  571.  FREEVERT      =  $0004;  { IF set, the knob can move vertically }
  572.  PROPBORDERLESS =  $0008;  { IF set, no border will be rendered }
  573.  KNOBHIT       =  $0100;  { set when this Knob is hit }
  574.  PROPNEWLOOK   =  $0010;  { set this IF you want to get the new
  575.                                  * V36 look
  576.                                  }
  577.  
  578.  KNOBHMIN      =  6;       { minimum horizontal size of the Knob }
  579.  KNOBVMIN      =  4;       { minimum vertical size of the Knob }
  580.  MAXBODY       =  $FFFF;  { maximum body value }
  581.  MAXPOT        =  $FFFF;  { maximum pot value }
  582.  
  583. { ======================================================================== }
  584. { === StringInfo ========================================================= }
  585. { ======================================================================== }
  586. { this is the special data required by the string Gadget
  587.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  588.  }
  589.  
  590. Type
  591.  
  592.     pStringInfo = ^tStringInfo;
  593.     tStringInfo = record
  594.     { you initialize these variables, and then Intuition maintains them }
  595.         Buffer          : STRPTR;       { the buffer containing the start and final string }
  596.         UndoBuffer      : STRPTR;       { optional buffer for undoing current entry }
  597.         BufferPos       : Integer;        { character position in Buffer }
  598.         MaxChars        : Integer;        { max number of chars in Buffer (including NULL) }
  599.         DispPos         : Integer;        { Buffer position of first displayed character }
  600.  
  601.     { Intuition initializes and maintains these variables for you }
  602.  
  603.         UndoPos         : Integer;        { character position in the undo buffer }
  604.         NumChars        : Integer;        { number of characters currently in Buffer }
  605.         DispCount       : Integer;        { number of whole characters visible in Container }
  606.         CLeft,
  607.         CTop            : Integer;        { topleft offset of the container }
  608.  
  609.     { you can initialize this variable before the gadget is submitted to
  610.      * Intuition, and then examine it later to discover what Longint
  611.      * the user has entered (if the user never plays with the gadget,
  612.      * the value will be unchanged from your initial setting)
  613.      }
  614.         Extension       : Pointer;
  615.         _LongInt         : Longint;
  616.  
  617.     { If you want this Gadget to use your own Console keymapping, you
  618.      * set the ALTKEYMAP bit in the Activation flags of the Gadget, and then
  619.      * set this variable to point to your keymap.  If you don't set the
  620.      * ALTKEYMAP, you'll get the standard ASCII keymapping.
  621.      }
  622.  
  623.         AltKeyMap       : Pointer;
  624.     end;
  625.  
  626.  
  627. { ======================================================================== }
  628. { === Requester ========================================================== }
  629. { ======================================================================== }
  630.  
  631. Type
  632.  
  633.     pRequester = ^tRequester;
  634.     tRequester = record
  635.     { the ClipRect and BitMap and used for rendering the requester }
  636.         OlderRequest    : pRequester;
  637.         LeftEdge,
  638.         TopEdge         : Integer;        { dimensions of the entire box }
  639.         Width,
  640.         Height          : Integer;        { dimensions of the entire box }
  641.         RelLeft,
  642.         RelTop          : Integer;        { for Pointer relativity offsets }
  643.  
  644.         ReqGadget       : pGadget;    { pointer to a list of Gadgets }
  645.         ReqBorder       : pBorder;    { the box's border }
  646.         ReqText         : pIntuiText; { the box's text }
  647.         Flags           : Word;        { see definitions below }
  648.  
  649.     { pen number for back-plane fill before draws }
  650.  
  651.         BackFill        : Byte;
  652.  
  653.     { Layer in place of clip rect       }
  654.  
  655.         ReqLayer        : pLayer;
  656.  
  657.         ReqPad1         : Array [0..31] of Byte;
  658.  
  659.     { If the BitMap plane pointers are non-zero, this tells the system
  660.      * that the image comes pre-drawn (if the appliprog wants to define
  661.      * it's own box, in any shape or size it wants!);  this is OK by
  662.      * Intuition as long as there's a good correspondence between
  663.      * the image and the specified Gadgets
  664.      }
  665.  
  666.         ImageBMap       : pBitMap;    { points to the BitMap of PREDRAWN imagery }
  667.         RWindow         : Pointer;      { added.  points back to Window }
  668.         ReqImage        : Pointer;
  669.         ReqPad2         : Array [0..31] of Shortint;
  670.     end;
  671.  
  672.  
  673. Const
  674.  
  675. { FLAGS SET BY THE APPLIPROG }
  676.     POINTREL            = $0001;    { if POINTREL set, TopLeft is relative to pointer}
  677.     PREDRAWN            = $0002;    { if ReqBMap points to predrawn Requester imagery }
  678.     NOISYREQ            = $0004;    { if you don't want requester to filter input          }
  679.  
  680.     SIMPLEREQ           = $0010;
  681.         { to use SIMPLEREFRESH layer (recommended)     }
  682.  
  683.     { New for V36          }
  684.     USEREQIMAGE         = $0020;
  685.          {  render linked list ReqImage after BackFill
  686.          * but before gadgets and text
  687.          }
  688.     NOREQBACKFILL       = $0040;
  689.         { don't bother filling requester with Requester.BackFill pen   }
  690.  
  691.  
  692. { FLAGS SET BY INTUITION }
  693.     REQOFFWINDOW        = $1000;        { part of one of the Gadgets was offwindow }
  694.     REQACTIVE           = $2000;        { this requester is active }
  695.     SYSREQUEST          = $4000;        { this requester caused by system }
  696.     DEFERREFRESH        = $8000;        { this Requester stops a Refresh broadcast }
  697.  
  698.  
  699.  
  700.  
  701. { ======================================================================== }
  702. { === Image ============================================================== }
  703. { ======================================================================== }
  704. { This is a brief image structure for very simple transfers of
  705.  * image data to a RastPort
  706.  }
  707.  
  708. Type
  709.     pImage = ^tImage;
  710.     tImage = record
  711.         LeftEdge        : Integer;        { starting offset relative to some origin }
  712.         TopEdge         : Integer;        { starting offsets relative to some origin }
  713.         Width           : Integer;        { pixel size (though data is word-aligned) }
  714.         Height,
  715.         Depth           : Integer;        { pixel sizes }
  716.         ImageData       : Pointer;      { pointer to the actual word-aligned bits }
  717.  
  718.     { the PlanePick and PlaneOnOff variables work much the same way as the
  719.      * equivalent GELS Bob variables.  It's a space-saving
  720.      * mechanism for image data.  Rather than defining the image data
  721.      * for every plane of the RastPort, you need define data only
  722.      * for the planes that are not entirely zero or one.  As you
  723.      * define your Imagery, you will often find that most of the planes
  724.      * ARE just as color selectors.  For instance, if you're designing
  725.      * a two-color Gadget to use colors two and three, and the Gadget
  726.      * will reside in a five-plane display, bit plane zero of your
  727.      * imagery would be all ones, bit plane one would have data that
  728.      * describes the imagery, and bit planes two through four would be
  729.      * all zeroes.  Using these flags allows you to avoid wasting all
  730.      * that memory in this way:  first, you specify which planes you
  731.      * want your data to appear in using the PlanePick variable.  For
  732.      * each bit set in the variable, the next "plane" of your image
  733.      * data is blitted to the display.  For each bit clear in this
  734.      * variable, the corresponding bit in PlaneOnOff is examined.
  735.      * If that bit is clear, a "plane" of zeroes will be used.
  736.      * If the bit is set, ones will go out instead.  So, for our example:
  737.      *   Gadget.PlanePick = $02;
  738.      *   Gadget.PlaneOnOff = $01;
  739.      * Note that this also allows for generic Gadgets, like the
  740.      * System Gadgets, which will work in any number of bit planes.
  741.      * Note also that if you want an Image that is only a filled
  742.      * rectangle, you can get this by setting PlanePick to zero
  743.      * (pick no planes of data) and set PlaneOnOff to describe the pen
  744.      * color of the rectangle.
  745.      }
  746.  
  747.         PlanePick,
  748.         PlaneOnOff      : Byte;
  749.  
  750.     { if the NextImage variable is not NULL, Intuition presumes that
  751.      * it points to another Image structure with another Image to be
  752.      * rendered
  753.      }
  754.  
  755.         NextImage       : pImage;
  756.     end;
  757.  
  758.  
  759. { New for V39, Intuition supports the IESUBCLASS_NEWTABLET subclass
  760.  * of the IECLASS_NEWPOINTERPOS event.  The ie_EventAddress of such
  761.  * an event points to a TabletData structure (see below).
  762.  *
  763.  * The TabletData structure contains certain elements including a taglist.
  764.  * The taglist can be used for special tablet parameters.  A tablet driver
  765.  * should include only those tag-items the tablet supports.  An application
  766.  * can listen for any tag-items that interest it.  Note: an application
  767.  * must set the WA_TabletMessages attribute to TRUE to receive this
  768.  * extended information in its IntuiMessages.
  769.  *
  770.  * The definitions given here MUST be followed.  Pay careful attention
  771.  * to normalization and the interpretation of signs.
  772.  *
  773.  * TABLETA_TabletZ:  the current value of the tablet in the Z direction.
  774.  * This unsigned value should typically be in the natural units of the
  775.  * tablet.  You should also provide TABLETA_RangeZ.
  776.  *
  777.  * TABLETA_RangeZ:  the maximum value of the tablet in the Z direction.
  778.  * Normally specified along with TABLETA_TabletZ, this allows the
  779.  * application to scale the actual Z value across its range.
  780.  *
  781.  * TABLETA_AngleX:  the angle of rotation or tilt about the X-axis.  This
  782.  * number should be normalized to fill a signed long Longint.  Positive
  783.  * values imply a clockwise rotation about the X-axis when viewing
  784.  * from +X towards the origin.
  785.  *
  786.  * TABLETA_AngleY:  the angle of rotation or tilt about the Y-axis.  This
  787.  * number should be normalized to fill a signed long Longint.  Positive
  788.  * values imply a clockwise rotation about the Y-axis when viewing
  789.  * from +Y towards the origin.
  790.  *
  791.  * TABLETA_AngleZ:  the angle of rotation or tilt about the Z axis.  This
  792.  * number should be normalized to fill a signed long Longint.  Positive
  793.  * values imply a clockwise rotation about the Z-axis when viewing
  794.  * from +Z towards the origin.
  795.  *
  796.  *      Note: a stylus that supports tilt should use the TABLETA_AngleX
  797.  *      and TABLETA_AngleY attributes.  Tilting the stylus so the tip
  798.  *      points towards increasing or decreasing X is actually a rotation
  799.  *      around the Y-axis.  Thus, if the stylus tip points towards
  800.  *      positive X, then that tilt is represented as a negative
  801.  *      TABLETA_AngleY.  Likewise, if the stylus tip points towards
  802.  *      positive Y, that tilt is represented by positive TABLETA_AngleX.
  803.  *
  804.  * TABLETA_Pressure:  the pressure reading of the stylus.  The pressure
  805.  * should be normalized to fill a signed long Longint.  Typical devices
  806.  * won't generate negative pressure, but the possibility is not precluded.
  807.  * The pressure threshold which is considered to cause a button-click is
  808.  * expected to be set in a Preferences program supplied by the tablet
  809.  * vendor.  The tablet driver would send IECODE_LBUTTON-type events as
  810.  * the pressure crossed that threshold.
  811.  *
  812.  * TABLETA_ButtonBits:  ti_Data is a long Longint whose bits are to
  813.  * be interpreted at the state of the first 32 buttons of the tablet.
  814.  *
  815.  * TABLETA_InProximity:  ti_Data is a boolean.  For tablets that support
  816.  * proximity, they should send the (TABLETA_InProximity,FALSE) tag item
  817.  * when the stylus is out of proximity.  One possible use we can forsee
  818.  * is a mouse-blanking commodity which keys off this to blank the
  819.  * mouse.  When this tag is absent, the stylus is assumed to be
  820.  * in proximity.
  821.  *
  822.  * TABLETA_ResolutionX:  ti_Data is an unsigned long Longint which
  823.  * is the x-axis resolution in dots per inch.
  824.  *
  825.  * TABLETA_ResolutionY:  ti_Data is an unsigned long Longint which
  826.  * is the y-axis resolution in dots per inch.
  827.  }
  828.  
  829. const
  830.  TABLETA_Dummy          = (TAG_USER + $3A000)  ;
  831.  TABLETA_TabletZ        = (TABLETA_Dummy + $01);
  832.  TABLETA_RangeZ         = (TABLETA_Dummy + $02);
  833.  TABLETA_AngleX         = (TABLETA_Dummy + $03);
  834.  TABLETA_AngleY         = (TABLETA_Dummy + $04);
  835.  TABLETA_AngleZ         = (TABLETA_Dummy + $05);
  836.  TABLETA_Pressure       = (TABLETA_Dummy + $06);
  837.  TABLETA_ButtonBits     = (TABLETA_Dummy + $07);
  838.  TABLETA_InProximity    = (TABLETA_Dummy + $08);
  839.  TABLETA_ResolutionX    = (TABLETA_Dummy + $09);
  840.  TABLETA_ResolutionY    = (TABLETA_Dummy + $0A);
  841.  
  842. { If your window sets WA_TabletMessages to TRUE, then it will receive
  843.  * extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData
  844.  * field points at a TabletData structure.  This structure contains
  845.  * additional information about the input event.
  846.  }
  847.  
  848. Type
  849.  pTabletData = ^tTabletData;
  850.  tTabletData = record
  851.     { Sub-pixel position of tablet, in screen coordinates,
  852.      * scaled to fill a UWORD fraction:
  853.      }
  854.     td_XFraction, td_YFraction  : WORD;
  855.  
  856.     { Current tablet coordinates along each axis: }
  857.     td_TabletX, td_TabletY      : ULONG;
  858.  
  859.     { Tablet range along each axis.  For example, if td_TabletX
  860.      * can take values 0-999, td_RangeX should be 1000.
  861.      }
  862.     td_RangeX, td_RangeY        : ULONG;
  863.  
  864.     { Pointer to tag-list of additional tablet attributes.
  865.      * See <intuition/intuition.h> for the tag values.
  866.      }
  867.     td_TagList                  : pTagItem;
  868.  end;
  869.  
  870. { If a tablet driver supplies a hook for ient_CallBack, it will be
  871.  * invoked in the standard hook manner.  A0 will point to the Hook
  872.  * itself, A2 will point to the InputEvent that was sent, and
  873.  * A1 will point to a TabletHookData structure.  The InputEvent's
  874.  * ie_EventAddress field points at the IENewTablet structure that
  875.  * the driver supplied.
  876.  *
  877.  * Based on the thd_Screen, thd_Width, and thd_Height fields, the driver
  878.  * should scale the ient_TabletX and ient_TabletY fields and store the
  879.  * result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and
  880.  * ient_ScaledYFraction.
  881.  *
  882.  * The tablet hook must currently return NULL.  This is the only
  883.  * acceptable return-value under V39.
  884.  }
  885.  
  886.  pTabletHookData = ^tTabletHookData;
  887.  tTabletHookData = record
  888.     { Pointer to the active screen:
  889.      * Note: if there are no open screens, thd_Screen will be NULL.
  890.      * thd_Width and thd_Height will then describe an NTSC 64$400
  891.      * screen.  Please scale accordingly.
  892.      }
  893.     thd_Screen      : Pointer;
  894.  
  895.     { The width and height (measured in pixels of the active screen)
  896.      * that your are to scale to:
  897.      }
  898.     thd_Width,
  899.     thd_Height      : ULONG;
  900.  
  901.     { Non-zero if the screen or something about the screen
  902.      * changed since the last time you were invoked:
  903.      }
  904.     thd_ScreenChanged   : Longint;
  905.  end;
  906.  
  907.  
  908. { ======================================================================== }
  909. { === IntuiMessage ======================================================= }
  910. { ======================================================================== }
  911.  
  912. Type
  913.  
  914.     pIntuiMessage = ^tIntuiMessage;
  915.     tIntuiMessage = record
  916.         ExecMessage     : tMessage;
  917.  
  918.     { the Class bits correspond directly with the IDCMP Flags, except for the
  919.      * special bit LONELYMESSAGE (defined below)
  920.      }
  921.  
  922.         IClass           : ULONG;
  923.  
  924.     { the Code field is for special values like MENU number }
  925.  
  926.         Code            : Word;
  927.  
  928.     { the Qualifier field is a copy of the current InputEvent's Qualifier }
  929.  
  930.         Qualifier       : Word;
  931.  
  932.     { IAddress contains particular addresses for Intuition functions, like
  933.      * the pointer to the Gadget or the Screen
  934.      }
  935.  
  936.         IAddress        : Pointer;
  937.  
  938.     { when getting mouse movement reports, any event you get will have the
  939.      * the mouse coordinates in these variables.  the coordinates are relative
  940.      * to the upper-left corner of your Window (GIMMEZEROZERO notwithstanding)
  941.      }
  942.  
  943.         MouseX,
  944.         MouseY          : Integer;
  945.  
  946.     { the time values are copies of the current system clock time.  Micros
  947.      * are in units of microseconds, Seconds in seconds.
  948.      }
  949.  
  950.         Seconds,
  951.         Micros          : ULONG;
  952.  
  953.     { the IDCMPWindow variable will always have the Pointer of the Window of
  954.      * this IDCMP
  955.      }
  956.  
  957.         IDCMPWindow     : Pointer;
  958.  
  959.     { system-use variable }
  960.  
  961.         SpecialLink     : pIntuiMessage;
  962.     end;
  963.  
  964. { New for V39:
  965.  * All IntuiMessages are now slightly extended.  The ExtIntuiMessage
  966.  * structure has an additional field for tablet data, which is usually
  967.  * NULL.  If a tablet driver which is sending IESUBCLASS_NEWTABLET
  968.  * events is installed in the system, windows with the WA_TabletMessages
  969.  * property set will find that eim_TabletData points to the TabletData
  970.  * structure.  Applications must first check that this field is non-NULL;
  971.  * it will be NULL for certain kinds of message, including mouse activity
  972.  * generated from other than the tablet (i.e. the keyboard equivalents
  973.  * or the mouse itself).
  974.  *
  975.  * NEVER EVER examine any extended fields when running under pre-V39!
  976.  *
  977.  * NOTE: This structure is subject to grow in the future.  Making
  978.  * assumptions about its size is A BAD IDEA.
  979.  }
  980.  
  981.  pExtIntuiMessage = ^tExtIntuiMessage;
  982.  tExtIntuiMessage = record
  983.     eim_IntuiMessage  : tIntuiMessage;
  984.     eim_TabletData    : pTabletData;
  985.  end;
  986.  
  987.  
  988. CONST
  989.  
  990. { --- IDCMP Classes ------------------------------------------------------ }
  991. { Please refer to the Autodoc for OpenWindow() and to the Rom Kernel
  992.  * Manual for full details on the IDCMP classes.
  993.  }
  994.  IDCMP_SIZEVERIFY      =  $00000001;
  995.  IDCMP_NEWSIZE         =  $00000002;
  996.  IDCMP_REFRESHWINDOW   =  $00000004;
  997.  IDCMP_MOUSEBUTTONS    =  $00000008;
  998.  IDCMP_MOUSEMOVE       =  $00000010;
  999.  IDCMP_GADGETDOWN      =  $00000020;
  1000.  IDCMP_GADGETUP        =  $00000040;
  1001.  IDCMP_REQSET          =  $00000080;
  1002.  IDCMP_MENUPICK        =  $00000100;
  1003.  IDCMP_CLOSEWINDOW     =  $00000200;
  1004.  IDCMP_RAWKEY          =  $00000400;
  1005.  IDCMP_REQVERIFY       =  $00000800;
  1006.  IDCMP_REQCLEAR        =  $00001000;
  1007.  IDCMP_MENUVERIFY      =  $00002000;
  1008.  IDCMP_NEWPREFS        =  $00004000;
  1009.  IDCMP_DISKINSERTED    =  $00008000;
  1010.  IDCMP_DISKREMOVED     =  $00010000;
  1011.  IDCMP_WBENCHMESSAGE   =  $00020000;  {  System use only         }
  1012.  IDCMP_ACTIVEWINDOW    =  $00040000;
  1013.  IDCMP_INACTIVEWINDOW  =  $00080000;
  1014.  IDCMP_DELTAMOVE       =  $00100000;
  1015.  IDCMP_VANILLAKEY      =  $00200000;
  1016.  IDCMP_INTUITICKS      =  $00400000;
  1017. {  for notifications from "boopsi" gadgets               }
  1018.  IDCMP_IDCMPUPDATE     =  $00800000;  { new for V36      }
  1019. { for getting help key report during menu session        }
  1020.  IDCMP_MENUHELP        =  $01000000;  { new for V36      }
  1021. { for notification of any move/size/zoom/change window   }
  1022.  IDCMP_CHANGEWINDOW    =  $02000000;  { new for V36      }
  1023.  IDCMP_GADGETHELP      =  $04000000;  { new for V39      }
  1024.  
  1025. { NOTEZ-BIEN:                          $80000000 is reserved for internal use   }
  1026.  
  1027. { the IDCMP Flags do not use this special bit, which is cleared when
  1028.  * Intuition sends its special message to the Task, and set when Intuition
  1029.  * gets its Message back from the Task.  Therefore, I can check here to
  1030.  * find out fast whether or not this Message is available for me to send
  1031.  }
  1032.  IDCMP_LONELYMESSAGE   =  $80000000;
  1033.  
  1034.  
  1035. { --- IDCMP Codes -------------------------------------------------------- }
  1036. { This group of codes is for the IDCMP_CHANGEWINDOW message }
  1037.  CWCODE_MOVESIZE = $0000;  { Window was moved and/or sized }
  1038.  CWCODE_DEPTH    = $0001;  { Window was depth-arranged (new for V39) }
  1039.  
  1040. { This group of codes is for the IDCMP_MENUVERIFY function }
  1041.  MENUHOT       =  $0001;  { IntuiWants verification OR MENUCANCEL    }
  1042.  MENUCANCEL    =  $0002;  { HOT Reply of this cancels Menu operation }
  1043.  MENUWAITING   =  $0003;  { Intuition simply wants a ReplyMsg() ASAP }
  1044.  
  1045. { These are internal tokens to represent state of verification attempts
  1046.  * shown here as a clue.
  1047.  }
  1048.  OKOK          =  MENUHOT; { guy didn't care                      }
  1049.  OKABORT       =  $0004;  { window rendered question moot        }
  1050.  OKCANCEL      =  MENUCANCEL; { window sent cancel reply          }
  1051.  
  1052. { This group of codes is for the IDCMP_WBENCHMESSAGE messages }
  1053.  WBENCHOPEN    =  $0001;
  1054.  WBENCHCLOSE   =  $0002;
  1055.  
  1056.  
  1057. { A data structure common in V36 Intuition processing  }
  1058. Type
  1059.    pIBox = ^tIBox;
  1060.    tIBox = record
  1061.     Left,
  1062.     Top,
  1063.     Width,
  1064.     Height : Integer;
  1065.    END;
  1066.  
  1067.  
  1068. { ======================================================================== }
  1069. { === Window ============================================================= }
  1070. { ======================================================================== }
  1071.  
  1072. Type
  1073.  
  1074.     pWindow = ^tWindow;
  1075.     tWindow = record
  1076.         NextWindow      : pWindow;      { for the linked list in a screen }
  1077.  
  1078.         LeftEdge,
  1079.         TopEdge         : Integer;        { screen dimensions of window }
  1080.         Width,
  1081.         Height          : Integer;        { screen dimensions of window }
  1082.  
  1083.         MouseY,
  1084.         MouseX          : Integer;        { relative to upper-left of window }
  1085.  
  1086.         MinWidth,
  1087.         MinHeight       : Integer;        { minimum sizes }
  1088.         MaxWidth,
  1089.         MaxHeight       : Word;        { maximum sizes }
  1090.  
  1091.         Flags           : ULONG;      { see below for defines }
  1092.  
  1093.         MenuStrip       : pMenu;      { the strip of Menu headers }
  1094.  
  1095.         Title           : STRPTR;       { the title text for this window }
  1096.  
  1097.         FirstRequest    : pRequester; { all active Requesters }
  1098.  
  1099.         DMRequest       : pRequester; { double-click Requester }
  1100.  
  1101.         ReqCount        : Integer;        { count of reqs blocking Window }
  1102.  
  1103.         WScreen         : Pointer;      { this Window's Screen }
  1104.         RPort           : pRastPort;  { this Window's very own RastPort }
  1105.  
  1106.     { the border variables describe the window border.   If you specify
  1107.      * GIMMEZEROZERO when you open the window, then the upper-left of the
  1108.      * ClipRect for this window will be upper-left of the BitMap (with correct
  1109.      * offsets when in SuperBitMap mode; you MUST select GIMMEZEROZERO when
  1110.      * using SuperBitMap).  If you don't specify ZeroZero, then you save
  1111.      * memory (no allocation of RastPort, Layer, ClipRect and associated
  1112.      * Bitmaps), but you also must offset all your writes by BorderTop,
  1113.      * BorderLeft and do your own mini-clipping to prevent writing over the
  1114.      * system gadgets
  1115.      }
  1116.  
  1117.         BorderLeft,
  1118.         BorderTop,
  1119.         BorderRight,
  1120.         BorderBottom    : Shortint;
  1121.         BorderRPort     : pRastPort;
  1122.  
  1123.  
  1124.     { You supply a linked-list of Gadgets for your Window.
  1125.      * This list DOES NOT include system gadgets.  You get the standard
  1126.      * window system gadgets by setting flag-bits in the variable Flags (see
  1127.      * the bit definitions below)
  1128.      }
  1129.  
  1130.         FirstGadget     : pGadget;
  1131.  
  1132.     { these are for opening/closing the windows }
  1133.  
  1134.         Parent,
  1135.         Descendant      : pWindow;
  1136.  
  1137.     { sprite data information for your own Pointer
  1138.      * set these AFTER you Open the Window by calling SetPointer()
  1139.      }
  1140.  
  1141.         _Pointer         : Pointer;      { sprite data }
  1142.         PtrHeight       : Shortint;         { sprite height (not including sprite padding) }
  1143.         PtrWidth        : Shortint;         { sprite width (must be less than or equal to 16) }
  1144.         XOffset,
  1145.         YOffset         : Shortint;         { sprite offsets }
  1146.  
  1147.     { the IDCMP Flags and User's and Intuition's Message Ports }
  1148.         IDCMPFlags      : ULONG;      { User-selected flags }
  1149.         UserPort,
  1150.         WindowPort      : pMsgPort;
  1151.         MessageKey      : pIntuiMessage;
  1152.  
  1153.         DetailPen,
  1154.         BlockPen        : Byte; { for bar/border/gadget rendering }
  1155.  
  1156.     { the CheckMark is a pointer to the imagery that will be used when
  1157.      * rendering MenuItems of this Window that want to be checkmarked
  1158.      * if this is equal to NULL, you'll get the default imagery
  1159.      }
  1160.  
  1161.         CheckMark       : pImage;
  1162.  
  1163.         ScreenTitle     : STRPTR; { if non-null, Screen title when Window is active }
  1164.  
  1165.     { These variables have the mouse coordinates relative to the
  1166.      * inner-Window of GIMMEZEROZERO Windows.  This is compared with the
  1167.      * MouseX and MouseY variables, which contain the mouse coordinates
  1168.      * relative to the upper-left corner of the Window, GIMMEZEROZERO
  1169.      * notwithstanding
  1170.      }
  1171.  
  1172.         GZZMouseX       : Integer;
  1173.         GZZMouseY       : Integer;
  1174.  
  1175.     { these variables contain the width and height of the inner-Window of
  1176.      * GIMMEZEROZERO Windows
  1177.      }
  1178.  
  1179.         GZZWidth        : Integer;
  1180.         GZZHeight       : Integer;
  1181.  
  1182.         ExtData         : Pointer;
  1183.  
  1184.         UserData        : Pointer;      { general-purpose pointer to User data extension }
  1185.  
  1186.     {* jimm: NEW: 11/18/85: this pointer keeps a duplicate of what
  1187.      * Window.RPort->Layer is _supposed_ to be pointing at
  1188.      }
  1189.  
  1190.         WLayer          : pLayer;
  1191.  
  1192.     { jimm: NEW 1.2: need to keep track of the font that
  1193.      * OpenWindow opened, in case user SetFont's into RastPort
  1194.      }
  1195.  
  1196.         IFont           : pTextFont;
  1197.     {* (V36) another flag word (the Flags field is used up).
  1198.      * At present, all flag values are system private.
  1199.      * Until further notice, you may not change nor use this field.
  1200.      *}
  1201.         MoreFlags       : ULONG;
  1202.  
  1203.     {**** Data beyond this point are Intuition Private.  DO NOT USE ****}
  1204.  
  1205.     end;
  1206.  
  1207. CONST
  1208. { --- Flags requested at OpenWindow() time by the application --------- }
  1209.  WFLG_SIZEGADGET   =  $00000001;  { include sizing system-gadget? }
  1210.  WFLG_DRAGBAR      =  $00000002;  { include dragging system-gadget? }
  1211.  WFLG_DEPTHGADGET  =  $00000004;  { include depth arrangement gadget? }
  1212.  WFLG_CLOSEGADGET  =  $00000008;  { include close-box system-gadget? }
  1213.  
  1214.  WFLG_SIZEBRIGHT   =  $00000010;  { size gadget uses right border }
  1215.  WFLG_SIZEBBOTTOM  =  $00000020;  { size gadget uses bottom border }
  1216.  
  1217. { --- refresh modes ------------------------------------------------------ }
  1218. { combinations of the WFLG_REFRESHBITS select the refresh type }
  1219.  WFLG_REFRESHBITS   = $000000C0;
  1220.  WFLG_SMART_REFRESH = $00000000;
  1221.  WFLG_SIMPLE_REFRESH= $00000040;
  1222.  WFLG_SUPER_BITMAP  = $00000080;
  1223.  WFLG_OTHER_REFRESH = $000000C0;
  1224.  
  1225.  WFLG_BACKDROP      = $00000100;  { this is a backdrop window }
  1226.  
  1227.  WFLG_REPORTMOUSE   = $00000200;  { to hear about every mouse move }
  1228.  
  1229.  WFLG_GIMMEZEROZERO = $00000400;  { a GimmeZeroZero window       }
  1230.  
  1231.  WFLG_BORDERLESS    = $00000800;  { to get a Window sans border }
  1232.  
  1233.  WFLG_ACTIVATE      = $00001000;  { when Window opens, it's Active }
  1234.  
  1235.  
  1236. { --- Other User Flags --------------------------------------------------- }
  1237.  WFLG_RMBTRAP       = $00010000;  { Catch RMB events for your own }
  1238.  WFLG_NOCAREREFRESH = $00020000;  { not to be bothered with REFRESH }
  1239.  
  1240. { - V36 new Flags which the programmer may specify in NewWindow.Flags  }
  1241.  WFLG_NW_EXTENDED   = $00040000;  { extension data provided      }
  1242.                                         { see struct ExtNewWindow      }
  1243.  
  1244. { - V39 new Flags which the programmer may specify in NewWindow.Flags  }
  1245.  WFLG_NEWLOOKMENUS  = $00200000;  { window has NewLook menus     }
  1246.  
  1247. { These flags are set only by Intuition.  YOU MAY NOT SET THEM YOURSELF! }
  1248.  WFLG_WINDOWACTIVE  = $00002000;  { this window is the active one }
  1249.  WFLG_INREQUEST     = $00004000;  { this window is in request mode }
  1250.  WFLG_MENUSTATE     = $00008000;  { Window is active with Menus on }
  1251.  WFLG_WINDOWREFRESH = $01000000;  { Window is currently refreshing }
  1252.  WFLG_WBENCHWINDOW  = $02000000;  { WorkBench tool ONLY Window }
  1253.  WFLG_WINDOWTICKED  = $04000000;  { only one timer tick at a time }
  1254.  
  1255. { --- V36 Flags to be set only by Intuition -------------------------  }
  1256.  WFLG_VISITOR       = $08000000;  { visitor window               }
  1257.  WFLG_ZOOMED        = $10000000;  { identifies "zoom state"      }
  1258.  WFLG_HASZOOM       = $20000000;  { windowhas a zoom gadget      }
  1259.  
  1260. { --- Other Window Values ---------------------------------------------- }
  1261.  DEFAULTMOUSEQUEUE  =     (5);     { no more mouse messages       }
  1262.  
  1263. { --- see struct IntuiMessage for the IDCMP Flag definitions ------------- }
  1264.  
  1265.  
  1266. { ======================================================================== }
  1267. { === NewWindow ========================================================== }
  1268. { ======================================================================== }
  1269.  
  1270. Type
  1271.  
  1272.     pNewWindow = ^tNewWindow;
  1273.     tNewWindow = record
  1274.         LeftEdge,
  1275.         TopEdge         : Integer;        { screen dimensions of window }
  1276.         Width,
  1277.         Height          : Integer;        { screen dimensions of window }
  1278.  
  1279.         DetailPen,
  1280.         BlockPen        : Byte;         { for bar/border/gadget rendering }
  1281.  
  1282.         IDCMPFlags      : ULONG;      { User-selected IDCMP flags }
  1283.  
  1284.         Flags           : ULONG;      { see Window struct for defines }
  1285.  
  1286.     { You supply a linked-list of Gadgets for your Window.
  1287.      *  This list DOES NOT include system Gadgets.  You get the standard
  1288.      *  system Window Gadgets by setting flag-bits in the variable Flags (see
  1289.      *  the bit definitions under the Window structure definition)
  1290.      }
  1291.  
  1292.         FirstGadget     : pGadget;
  1293.  
  1294.     { the CheckMark is a pointer to the imagery that will be used when
  1295.      * rendering MenuItems of this Window that want to be checkmarked
  1296.      * if this is equal to NULL, you'll get the default imagery
  1297.      }
  1298.  
  1299.         CheckMark       : pImage;
  1300.  
  1301.         Title           : STRPTR;  { the title text for this window }
  1302.  
  1303.     { the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  1304.      * want this Window to open in it.  If so, you pass the Pointer of the
  1305.      * Custom Screen structure in this variable.  Otherwise, this variable
  1306.      * is ignored and doesn't have to be initialized.
  1307.      }
  1308.  
  1309.         Screen          : Pointer;
  1310.  
  1311.     { SUPER_BITMAP Window?  If so, put the Pointer of your BitMap structure
  1312.      * in this variable.  If not, this variable is ignored and doesn't have
  1313.      * to be initialized
  1314.      }
  1315.  
  1316.         BitMap          : pBitMap;
  1317.  
  1318.     { the values describe the minimum and maximum sizes of your Windows.
  1319.      * these matter only if you've chosen the WINDOWSIZING Gadget option,
  1320.      * which means that you want to let the User to change the size of
  1321.      * this Window.  You describe the minimum and maximum sizes that the
  1322.      * Window can grow by setting these variables.  You can initialize
  1323.      * any one these to zero, which will mean that you want to duplicate
  1324.      * the setting for that dimension (if MinWidth == 0, MinWidth will be
  1325.      * set to the opening Width of the Window).
  1326.      * You can change these settings later using SetWindowLimits().
  1327.      * If you haven't asked for a SIZING Gadget, you don't have to
  1328.      * initialize any of these variables.
  1329.      }
  1330.  
  1331.         MinWidth,
  1332.         MinHeight       : Integer;        { minimums }
  1333.         MaxWidth,
  1334.         MaxHeight       : Integer;        { maximums }
  1335.  
  1336.     { the type variable describes the Screen in which you want this Window to
  1337.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1338.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1339.      * type definitions under the Screen structure
  1340.      }
  1341.  
  1342.         WType           : Word;        { is "Type" in C includes }
  1343.     end;
  1344.  
  1345.  
  1346. { The following structure is the future NewWindow.  Compatibility
  1347.  * issues require that the size of NewWindow not change.
  1348.  * Data in the common part (NewWindow) indicates the the extension
  1349.  * fields are being used.
  1350.  * NOTE WELL: This structure may be subject to future extension.
  1351.  * Writing code depending on its size is not allowed.
  1352.  }
  1353.    pExtNewWindow = ^tExtNewWindow;
  1354.    tExtNewWindow = record
  1355.     LeftEdge, TopEdge : Integer;
  1356.     Width, Height : Integer;
  1357.  
  1358.     DetailPen, BlockPen : Byte;
  1359.     IDCMPFlags    : ULONG;
  1360.     Flags         : ULONG;
  1361.     FirstGadget   : pGadget;
  1362.  
  1363.     CheckMark     : pImage;
  1364.  
  1365.     Title         : STRPTR;
  1366.     WScreen       : Pointer;
  1367.     WBitMap       : pBitMap;
  1368.  
  1369.     MinWidth, MinHeight : Integer;
  1370.     MaxWidth, MaxHeight : Word;
  1371.  
  1372.     { the type variable describes the Screen in which you want this Window to
  1373.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1374.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1375.      * type definitions under the Screen structure.
  1376.      * A new possible value for this field is PUBLICSCREEN, which
  1377.      * defines the window as a 'visitor' window.  See below for
  1378.      * additional information provided.
  1379.      }
  1380.     WType  : Word;
  1381.  
  1382.     { ------------------------------------------------------- *
  1383.      * extensions for V36
  1384.      * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  1385.      * this field is assumed to point to an array ( or chain of arrays)
  1386.      * of TagItem structures.  See also ExtNewScreen for another
  1387.      * use of TagItems to pass optional data.
  1388.      *
  1389.      * see below for tag values and the corresponding data.
  1390.      }
  1391.     Extension : pTagItem;
  1392.   END;
  1393.  
  1394. {
  1395.  * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  1396.  * They are values in a TagItem array passed as extension/replacement
  1397.  * values for the data in NewWindow.  OpenWindowTagList() can actually
  1398.  * work well with a NULL NewWindow pointer.
  1399.  }
  1400. CONST
  1401.  WA_Dummy     =   (TAG_USER + 99); { $80000063   }
  1402.  
  1403. { these tags simply override NewWindow parameters }
  1404.  WA_Left               =  (WA_Dummy + $01);
  1405.  WA_Top                =  (WA_Dummy + $02);
  1406.  WA_Width              =  (WA_Dummy + $03);
  1407.  WA_Height             =  (WA_Dummy + $04);
  1408.  WA_DetailPen          =  (WA_Dummy + $05);
  1409.  WA_BlockPen           =  (WA_Dummy + $06);
  1410.  WA_IDCMP              =  (WA_Dummy + $07);
  1411.                         { "bulk" initialization of NewWindow.Flags }
  1412.  WA_Flags              =  (WA_Dummy + $08);
  1413.  WA_Gadgets            =  (WA_Dummy + $09);
  1414.  WA_Checkmark          =  (WA_Dummy + $0A);
  1415.  WA_Title              =  (WA_Dummy + $0B);
  1416.                         { means you don't have to call SetWindowTitles
  1417.                          * after you open your window
  1418.                          }
  1419.  WA_ScreenTitle        =  (WA_Dummy + $0C);
  1420.  WA_CustomScreen       =  (WA_Dummy + $0D);
  1421.  WA_SuperBitMap        =  (WA_Dummy + $0E);
  1422.                         { also implies WFLG_SUPER_BITMAP property      }
  1423.  WA_MinWidth           =  (WA_Dummy + $0F);
  1424.  WA_MinHeight          =  (WA_Dummy + $10);
  1425.  WA_MaxWidth           =  (WA_Dummy + $11);
  1426.  WA_MaxHeight          =  (WA_Dummy + $12);
  1427.  
  1428. { The following are specifications for new features    }
  1429.  
  1430.  WA_InnerWidth         =  (WA_Dummy + $13);
  1431.  WA_InnerHeight        =  (WA_Dummy + $14);
  1432.                         { You can specify the dimensions of the interior
  1433.                          * region of your window, independent of what
  1434.                          * the border widths will be.  You probably want
  1435.                          * to also specify WA_AutoAdjust to allow
  1436.                          * Intuition to move your window or even
  1437.                          * shrink it so that it is completely on screen.
  1438.                          }
  1439.  
  1440.  WA_PubScreenName      =  (WA_Dummy + $15);
  1441.                         { declares that you want the window to open as
  1442.                          * a visitor on the public screen whose name is
  1443.                          * pointed to by (UBYTE *) ti_Data
  1444.                          }
  1445.  WA_PubScreen          =  (WA_Dummy + $16);
  1446.                         { open as a visitor window on the public screen
  1447.                          * whose Pointer is in (struct Screen *) ti_Data.
  1448.                          * To ensure that this screen remains open, you
  1449.                          * should either be the screen's owner, have a
  1450.                          * window open on the screen, or use LockPubScreen().
  1451.                          }
  1452.  WA_PubScreenFallBack  =  (WA_Dummy + $17);
  1453.                         { A Boolean, specifies whether a visitor window
  1454.                          * should "fall back" to the default public screen
  1455.                          * (or Workbench) if the named public screen isn't
  1456.                          * available
  1457.                          }
  1458.  WA_WindowName         =  (WA_Dummy + $18);
  1459.                         { not implemented      }
  1460.  WA_Colors             =  (WA_Dummy + $19);
  1461.                         { a ColorSpec array for colors to be set
  1462.                          * when this window is active.  This is not
  1463.                          * implemented, and may not be, since the default
  1464.                          * values to restore would be hard to track.
  1465.                          * We'd like to at least support per-window colors
  1466.                          * for the mouse pointer sprite.
  1467.                          }
  1468.  WA_Zoom       =  (WA_Dummy + $1A);
  1469.                         { ti_Data points to an array of four WORD's,
  1470.                          * the initial Left/Top/Width/Height values of
  1471.                          * the "alternate" zoom position/dimensions.
  1472.                          * It also specifies that you want a Zoom gadget
  1473.                          * for your window, whether or not you have a
  1474.                          * sizing gadget.
  1475.                          }
  1476.  WA_MouseQueue         =  (WA_Dummy + $1B);
  1477.                         { ti_Data contains initial value for the mouse
  1478.                          * message backlog limit for this window.
  1479.                          }
  1480.  WA_BackFill           =  (WA_Dummy + $1C);
  1481.                         { unimplemented at present: provides a "backfill
  1482.                          * hook" for your window's layer.
  1483.                          }
  1484.  WA_RptQueue           =  (WA_Dummy + $1D);
  1485.                         { initial value of repeat key backlog limit    }
  1486.  
  1487.     { These Boolean tag items are alternatives to the NewWindow.Flags
  1488.      * boolean flags with similar names.
  1489.      }
  1490.  WA_SizeGadget         =  (WA_Dummy + $1E);
  1491.  WA_DragBar            =  (WA_Dummy + $1F);
  1492.  WA_DepthGadget        =  (WA_Dummy + $20);
  1493.  WA_CloseGadget        =  (WA_Dummy + $21);
  1494.  WA_Backdrop           =  (WA_Dummy + $22);
  1495.  WA_ReportMouse        =  (WA_Dummy + $23);
  1496.  WA_NoCareRefresh      =  (WA_Dummy + $24);
  1497.  WA_Borderless         =  (WA_Dummy + $25);
  1498.  WA_Activate           =  (WA_Dummy + $26);
  1499.  WA_RMBTrap            =  (WA_Dummy + $27);
  1500.  WA_WBenchWindow       =  (WA_Dummy + $28);       { PRIVATE!! }
  1501.  WA_SimpleRefresh      =  (WA_Dummy + $29);
  1502.                         { only specify if TRUE }
  1503.  WA_SmartRefresh       =  (WA_Dummy + $2A);
  1504.                         { only specify if TRUE }
  1505.  WA_SizeBRight         =  (WA_Dummy + $2B);
  1506.  WA_SizeBBottom        =  (WA_Dummy + $2C);
  1507.  
  1508.     { New Boolean properties   }
  1509.  WA_AutoAdjust         =  (WA_Dummy + $2D);
  1510.                         { shift or squeeze the window's position and
  1511.                          * dimensions to fit it on screen.
  1512.                          }
  1513.  
  1514.  WA_GimmeZeroZero      =  (WA_Dummy + $2E);
  1515.                         { equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO }
  1516.  
  1517. { New for V37: WA_MenuHelp (ignored by V36) }
  1518.  WA_MenuHelp           =  (WA_Dummy + $2F);
  1519.                         { Enables IDCMP_MENUHELP:  Pressing HELP during menus
  1520.                          * will return IDCMP_MENUHELP message.
  1521.                          }
  1522.  
  1523. { New for V39:  (ignored by V37 and earlier) }
  1524.  WA_NewLookMenus       =  (WA_Dummy + $30);
  1525.                         { Set to TRUE if you want NewLook menus }
  1526.  WA_AmigaKey           =  (WA_Dummy + $31);
  1527.                         { Pointer to image for Amiga-key equiv in menus }
  1528.  WA_NotifyDepth        =  (WA_Dummy + $32);
  1529.                         { Requests IDCMP_CHANGEWINDOW message when
  1530.                          * window is depth arranged
  1531.                          * (imsg->Code = CWCODE_DEPTH)
  1532.                          }
  1533.  
  1534. { WA_Dummy + $33 is obsolete }
  1535.  
  1536.  WA_Pointer            =  (WA_Dummy + $34);
  1537.                         { Allows you to specify a custom pointer
  1538.                          * for your window.  ti_Data points to a
  1539.                          * pointer object you obtained via
  1540.                          * "pointerclass". NULL signifies the
  1541.                          * default pointer.
  1542.                          * This tag may be passed to OpenWindowTags()
  1543.                          * or SetWindowPointer().
  1544.                          }
  1545.  
  1546.  WA_BusyPointer        =  (WA_Dummy + $35);
  1547.                         { ti_Data is boolean.  Set to TRUE to
  1548.                          * request the standard busy pointer.
  1549.                          * This tag may be passed to OpenWindowTags()
  1550.                          * or SetWindowPointer().
  1551.                          }
  1552.  
  1553.  WA_PointerDelay       =  (WA_Dummy + $36);
  1554.                         { ti_Data is boolean.  Set to TRUE to
  1555.                          * request that the changing of the
  1556.                          * pointer be slightly delayed.  The change
  1557.                          * will be called off if you call NewSetPointer()
  1558.                          * before the delay expires.  This allows
  1559.                          * you to post a busy-pointer even if you think
  1560.                          * the busy-time may be very Word, without
  1561.                          * fear of a flashing pointer.
  1562.                          * This tag may be passed to OpenWindowTags()
  1563.                          * or SetWindowPointer().
  1564.                          }
  1565.  
  1566.  WA_TabletMessages     =  (WA_Dummy + $37);
  1567.                         { ti_Data is a boolean.  Set to TRUE to
  1568.                          * request that tablet information be included
  1569.                          * in IntuiMessages sent to your window.
  1570.                          * Requires that something (i.e. a tablet driver)
  1571.                          * feed IESUBCLASS_NEWTABLET InputEvents into
  1572.                          * the system.  For a pointer to the TabletData,
  1573.                          * examine the ExtIntuiMessage->eim_TabletData
  1574.                          * field.  It is UNSAFE to check this field
  1575.                          * when running on pre-V39 systems.  It's always
  1576.                          * safe to check this field under V39 and up,
  1577.                          * though it may be NULL.
  1578.                          }
  1579.  
  1580.  WA_HelpGroup          =  (WA_Dummy + $38);
  1581.                         { When the active window has gadget help enabled,
  1582.                          * other windows of the same HelpGroup number
  1583.                          * will also get GadgetHelp.  This allows GadgetHelp
  1584.                          * to work for multi-windowed applications.
  1585.                          * Use GetGroupID() to get an ID number.  Pass
  1586.                          * this number as ti_Data to all your windows.
  1587.                          * See also the HelpControl() function.
  1588.                          }
  1589.  
  1590.  WA_HelpGroupWindow    =  (WA_Dummy + $39);
  1591.                         { When the active window has gadget help enabled,
  1592.                          * other windows of the same HelpGroup will also get
  1593.                          * GadgetHelp.  This allows GadgetHelp to work
  1594.                          * for multi-windowed applications.  As an alternative
  1595.                          * to WA_HelpGroup, you can pass a pointer to any
  1596.                          * other window of the same group to join its help
  1597.                          * group.  Defaults to NULL, which has no effect.
  1598.                          * See also the HelpControl() function.
  1599.                          }
  1600.  
  1601.  
  1602. { HelpControl() flags:
  1603.  *
  1604.  * HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more
  1605.  * windows.
  1606.  }
  1607.  
  1608.  HC_GADGETHELP  = 1;
  1609.  
  1610.  
  1611. { ======================================================================== }
  1612. { === Remember =========================================================== }
  1613. { ======================================================================== }
  1614. { this structure is used for remembering what memory has been allocated to
  1615.  * date by a given routine, so that a premature abort or systematic exit
  1616.  * can deallocate memory cleanly, easily, and completely
  1617.  }
  1618.  
  1619. Type
  1620.  
  1621.     pRemember = ^tRemember;
  1622.     tRemember = record
  1623.         NextRemember    : pRemember;
  1624.         RememberSize    : ULONG;
  1625.         Memory          : Pointer;
  1626.     end;
  1627.  
  1628.  
  1629. { === Color Spec ====================================================== }
  1630. { How to tell Intuition about RGB values for a color table entry. }
  1631.  
  1632.   pColorSpec = ^tColorSpec;
  1633.   tColorSpec = record
  1634.     ColorIndex  : Integer;     { -1 terminates an array of ColorSpec  }
  1635.     Red         : Word;     { only the _bottom_ 4 bits recognized }
  1636.     Green       : Word;     { only the _bottom_ 4 bits recognized }
  1637.     Blue        : Word;     { only the _bottom_ 4 bits recognized }
  1638.   END;
  1639.  
  1640. { === Easy Requester Specification ======================================= }
  1641. { see also autodocs for EasyRequest and BuildEasyRequest       }
  1642. { NOTE: This structure may grow in size in the future          }
  1643.  
  1644.    pEasyStruct = ^tEasyStruct;
  1645.    tEasyStruct = record
  1646.     es_StructSize   : ULONG;  { should be sizeof (struct EasyStruct )}
  1647.     es_Flags        : ULONG;  { should be 0 for now                  }
  1648.     es_Title        : STRPTR;   { title of requester window            }
  1649.     es_TextFormat   : STRPTR;   { 'printf' style formatting string     }
  1650.     es_GadgetFormat : STRPTR;   { 'printf' style formatting string   }
  1651.    END;
  1652.  
  1653.  
  1654.  
  1655. { ======================================================================== }
  1656. { === Miscellaneous ====================================================== }
  1657. { ======================================================================== }
  1658. CONST
  1659. { = MENU STUFF =========================================================== }
  1660.     NOMENU      = $001F;
  1661.     NOITEM      = $003F;
  1662.     NOSUB       = $001F;
  1663.     MENUNULL    = -1;
  1664.  
  1665.  
  1666. { = =RJ='s peculiarities ================================================= }
  1667.  
  1668. { these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT,
  1669.  * I'll use a generic Width (for all resolutions) for the CheckMark.
  1670.  * If COMMSEQ, likewise I'll use this generic stuff
  1671.  }
  1672.  
  1673.     CHECKWIDTH          = 19;
  1674.     COMMWIDTH           = 27;
  1675.     LOWCHECKWIDTH       = 13;
  1676.     LOWCOMMWIDTH        = 16;
  1677.  
  1678. { these are the AlertNumber defines.  if you are calling DisplayAlert()
  1679.  * the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1680.  * of these patterns
  1681.  }
  1682.  
  1683.     ALERT_TYPE          = $80000000;
  1684.     RECOVERY_ALERT      = $00000000;    { the system can recover from this }
  1685.     DEADEND_ALERT       = $80000000;    { no recovery possible, this is it }
  1686.  
  1687.  
  1688. { When you're defining IntuiText for the Positive and Negative Gadgets
  1689.  * created by a call to AutoRequest(), these defines will get you
  1690.  * reasonable-looking text.  The only field without a define is the IText
  1691.  * field; you decide what text goes with the Gadget
  1692.  }
  1693.  
  1694.     AUTOFRONTPEN        = 0;
  1695.     AUTOBACKPEN         = 1;
  1696.     AUTODRAWMODE        = JAM2;
  1697.     AUTOLEFTEDGE        = 6;
  1698.     AUTOTOPEDGE         = 3;
  1699.  
  1700. { -
  1701.     AUTOITEXTFONT       = Nil;
  1702.     AUTONEXTTEXT        = Nil;
  1703. - }
  1704.  
  1705.  
  1706. { --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- }
  1707.  
  1708.  
  1709.     SELECTUP            = IECODE_LBUTTON + IECODE_UP_PREFIX;
  1710.     SELECTDOWN          = IECODE_LBUTTON;
  1711.     MENUUP              = IECODE_RBUTTON + IECODE_UP_PREFIX;
  1712.     MENUDOWN            = IECODE_RBUTTON;
  1713.     ALTLEFT             = IEQUALIFIER_LALT;
  1714.     ALTRIGHT            = IEQUALIFIER_RALT;
  1715.     AMIGALEFT           = IEQUALIFIER_LCOMMAND;
  1716.     AMIGARIGHT          = IEQUALIFIER_RCOMMAND;
  1717.     AMIGAKEYS           = AMIGALEFT + AMIGARIGHT;
  1718.  
  1719.     CURSORUP            = $4C;
  1720.     CURSORLEFT          = $4F;
  1721.     CURSORRIGHT         = $4E;
  1722.     CURSORDOWN          = $4D;
  1723.     KEYCODE_Q           = $10;
  1724.     KEYCODE_X           = $32;
  1725.     KEYCODE_N           = $36;
  1726.     KEYCODE_M           = $37;
  1727.     KEYCODE_V           = $34;
  1728.     KEYCODE_B           = $35;
  1729.     KEYCODE_LESS        = $38;
  1730.     KEYCODE_GREATER     = $39;
  1731.  
  1732. { these are the display modes for which we have corresponding parameter
  1733.  *  settings in the config arrays
  1734.  }
  1735. CONST
  1736.  DMODECOUNT    =  $0002;  { how many modes there are }
  1737.  HIRESPICK     =  $0000;
  1738.  LOWRESPICK    =  $0001;
  1739.  
  1740.  EVENTMAX = 10;             { size of event array }
  1741.  
  1742. { these are the system Gadget defines }
  1743.  RESCOUNT       = 2;
  1744.  HIRESGADGET    = 0;
  1745.  LOWRESGADGET   = 1;
  1746.  
  1747.  GADGETCOUNT    = 8;
  1748.  UPFRONTGADGET  = 0;
  1749.  DOWNBACKGADGET = 1;
  1750.  SIZEGADGET     = 2;
  1751.  CLOSEGADGET    = 3;
  1752.  DRAGGADGET     = 4;
  1753.  SUPFRONTGADGET = 5;
  1754.  SDOWNBACKGADGET= 6;
  1755.  SDRAGGADGET    = 7;
  1756.  
  1757.  
  1758. { ======================================================================== }
  1759. { === DrawInfo ========================================================= }
  1760. { ======================================================================== }
  1761.  
  1762. { This is a packet of information for graphics rendering.  It originates
  1763.  * with a Screen, and is gotten using GetScreenDrawInfo( screen );
  1764.  }
  1765.  
  1766. { If you find dri_Version >= DRI_VERSION, you know this structure
  1767.  * has at least the fields defined in this version of the include file
  1768.  }
  1769. CONST
  1770.  RI_VERSION  =    (1);     { obsolete, will be removed            }
  1771.  DRI_VERSION =    (1);
  1772.  
  1773. Type
  1774.  
  1775.  pDrawInfo = ^tDrawInfo;
  1776.  tDrawInfo = record
  1777.     dri_Version : Word;    { will be  DRI_VERSION                 }
  1778.     dri_NumPens : Word;    { guaranteed to be >= numDrIPens       }
  1779.     dri_Pens    : Pointer;  { pointer to pen array                 }
  1780.  
  1781.     dri_Font    : pTextFont;      { screen default font          }
  1782.     dri_Depth   : Word;            { (initial) depth of screen bitmap     }
  1783.  
  1784.     dri_Resolution : record      { from DisplayInfo database for initial display mode }
  1785.                    x : word;
  1786.                    y : word;
  1787.                    end;
  1788.  
  1789.     dri_Flags : ULONG;              { defined below                }
  1790. { New for V39: dri_CheckMark, dri_AmigaKey. }
  1791.     dri_CheckMark : pImage; { ImagePtr }         { pointer to scaled checkmark image
  1792.                                                   * Will be NULL if DRI_VERSION < 2
  1793.                                                   }
  1794.     dri_AmigaKey  : pImage; { ImagePtr }    { pointer to scaled Amiga-key image
  1795.                                              * Will be NULL if DRI_VERSION < 2
  1796.                                              }
  1797.  
  1798.     dri_Reserved : Array[0..4] of ULONG;        { avoid recompilation ;^)      }
  1799.  END;
  1800.  
  1801. CONST
  1802.  DRIF_NEWLOOK =   $00000001;      { specified SA_Pens, full treatment }
  1803.  
  1804. { rendering pen number indexes into DrawInfo.dri_Pens[]        }
  1805.  DETAILPEN    =    ($0000);       { compatible Intuition rendering pens  }
  1806.  BLOCKPEN     =    ($0001);       { compatible Intuition rendering pens  }
  1807.  TEXTPEN      =    ($0002);       { text on background                   }
  1808.  SHINEPEN     =    ($0003);       { bright edge on 3D objects            }
  1809.  SHADOWPEN    =    ($0004);       { dark edge on 3D objects              }
  1810.  FILLPEN      =    ($0005);       { active-window/selected-gadget fill   }
  1811.  FILLTEXTPEN  =    ($0006);       { text over FILLPEN                    }
  1812.  BACKGROUNDPEN =   ($0007);       { always color 0                       }
  1813.  HIGHLIGHTTEXTPEN = ($0008);       { special color text, on background    }
  1814. { New for V39, only present if DRI_VERSION >= 2: }
  1815.  BARDETAILPEN   =  ($0009);       { text/detail in screen-bar/menus }
  1816.  BARBLOCKPEN    =  ($000A);       { screen-bar/menus fill }
  1817.  BARTRIMPEN     =  ($000B);       { trim under screen-bar }
  1818.  
  1819.  NUMDRIPENS   =    ($0009);
  1820.  
  1821. { New for V39:  It is sometimes useful to specify that a pen value
  1822.  * is to be the complement of color zero to three.  The "magic" numbers
  1823.  * serve that purpose:
  1824.  }
  1825.  PEN_C3        =  $FEFC;          { Complement of color 3 }
  1826.  PEN_C2        =  $FEFD;          { Complement of color 2 }
  1827.  PEN_C1        =  $FEFE;          { Complement of color 1 }
  1828.  PEN_C0        =  $FEFF;          { Complement of color 0 }
  1829.  
  1830. { ======================================================================== }
  1831. { === Screen ============================================================= }
  1832. { ======================================================================== }
  1833.  
  1834. Type
  1835.  
  1836.     pScreen = ^tScreen;
  1837.     tScreen = record
  1838.         NextScreen      : pScreen;      { linked list of screens }
  1839.         FirstWindow     : pWindow;      { linked list Screen's Windows }
  1840.  
  1841.         LeftEdge,
  1842.         TopEdge         : Integer;        { parameters of the screen }
  1843.         Width,
  1844.         Height          : Integer;        { parameters of the screen }
  1845.  
  1846.         MouseY,
  1847.         MouseX          : Integer;        { position relative to upper-left }
  1848.  
  1849.         Flags           : Word;        { see definitions below }
  1850.  
  1851.         Title           : STRPTR;       { null-terminated Title text }
  1852.         DefaultTitle    : STRPTR;       { for Windows without ScreenTitle }
  1853.  
  1854.     { Bar sizes for this Screen and all Window's in this Screen }
  1855.         BarHeight,
  1856.         BarVBorder,
  1857.         BarHBorder,
  1858.         MenuVBorder,
  1859.         MenuHBorder     : Shortint;
  1860.         WBorTop,
  1861.         WBorLeft,
  1862.         WBorRight,
  1863.         WBorBottom      : Shortint;
  1864.  
  1865.         Font            : pTextAttr;  { this screen's default font       }
  1866.  
  1867.     { the display data structures for this Screen (note the prefix S)}
  1868.         ViewPort        : tViewPort;     { describing the Screen's display }
  1869.         RastPort        : tRastPort;     { describing Screen rendering      }
  1870.         BitMap          : tBitMap;       { extra copy of RastPort BitMap   }
  1871.         LayerInfo       : tLayer_Info;   { each screen gets a LayerInfo     }
  1872.  
  1873.     { You supply a linked-list of Gadgets for your Screen.
  1874.      *  This list DOES NOT include system Gadgets.  You get the standard
  1875.      *  system Screen Gadgets by default
  1876.      }
  1877.  
  1878.         FirstGadget     : pGadget;
  1879.  
  1880.         DetailPen,
  1881.         BlockPen        : Byte;         { for bar/border/gadget rendering }
  1882.  
  1883.     { the following variable(s) are maintained by Intuition to support the
  1884.      * DisplayBeep() color flashing technique
  1885.      }
  1886.         SaveColor0      : Word;
  1887.  
  1888.     { This layer is for the Screen and Menu bars }
  1889.         BarLayer        : pLayer;
  1890.  
  1891.         ExtData         : Pointer;
  1892.         UserData        : Pointer;
  1893.                         { general-purpose pointer to User data extension }
  1894.     {**** Data below this point are SYSTEM PRIVATE ****}
  1895.  
  1896.     end;
  1897.  
  1898. Const
  1899.  
  1900. { The screen flags have the suffix "_f" added to avoid conflicts with
  1901.   routine names. }
  1902.  
  1903. { --- FLAGS SET BY INTUITION --------------------------------------------- }
  1904. { The SCREENTYPE bits are reserved for describing various Screen types
  1905.  * available under Intuition.
  1906.  }
  1907.     SCREENTYPE_f        = $000F;        { all the screens types available       }
  1908. { --- the definitions for the Screen Type ------------------------------- }
  1909.     WBENCHSCREEN_f      = $0001;        { Ta Da!  The Workbench         }
  1910.     CUSTOMSCREEN_f      = $000F;        { for that special look         }
  1911.  
  1912.     SHOWTITLE_f         = $0010;        { this gets set by a call to ShowTitle() }
  1913.  
  1914.     BEEPING_f           = $0020;        { set when Screen is beeping            }
  1915.  
  1916.     CUSTOMBITMAP_f      = $0040;        { if you are supplying your own BitMap }
  1917.  
  1918.     SCREENBEHIND_f      = $0080;        { if you want your screen to open behind
  1919.                                          * already open screens
  1920.                                          }
  1921.     SCREENQUIET_f       = $0100;        { if you do not want Intuition to render
  1922.                                          * into your screen (gadgets, title)     }
  1923.     SCREENHIRES         = $0200;        { do no use lowres gadgets (private)       }
  1924.  
  1925.     NS_EXTENDED         = $1000;          { ExtNewScreen.Extension is valid      }
  1926.     { V36 applications can use OpenScreenTagList() instead of NS_EXTENDED  }
  1927.  
  1928. { New for V39: }
  1929.     PENSHARED           = $0400;  { Screen opener set (SA_SharePens,TRUE) }
  1930.  
  1931.  
  1932.     AUTOSCROLL          = $4000;  { screen is to autoscoll               }
  1933.  
  1934.     STDSCREENHEIGHT     = -1;           { supply in NewScreen.Height            }
  1935.     STDSCREENWIDTH      = -1;           { supply in NewScreen.Width             }
  1936.  
  1937.  
  1938.  
  1939. {
  1940.  * Screen attribute tag ID's.  These are used in the ti_Tag field of
  1941.  * TagItem arrays passed to OpenScreenTagList() (or in the
  1942.  * ExtNewScreen.Extension field).
  1943.  }
  1944.  
  1945. { Screen attribute tags.  Please use these versions, not those in
  1946.  * iobsolete.h.
  1947.  }
  1948. CONST
  1949.   SA_Dummy    =    (TAG_USER + 32);
  1950. {
  1951.  * these items specify items equivalent to fields in NewScreen
  1952.  }
  1953.  SA_Left     =    (SA_Dummy + $0001);
  1954.  SA_Top      =    (SA_Dummy + $0002);
  1955.  SA_Width    =    (SA_Dummy + $0003);
  1956.  SA_Height   =    (SA_Dummy + $0004);
  1957.                         { traditional screen positions and dimensions  }
  1958.  SA_Depth    =    (SA_Dummy + $0005);
  1959.                         { screen bitmap depth                          }
  1960.  SA_DetailPen=    (SA_Dummy + $0006);
  1961.                         { serves as default for windows, too           }
  1962.  SA_BlockPen =    (SA_Dummy + $0007);
  1963.  SA_Title    =    (SA_Dummy + $0008);
  1964.                         { default screen title                         }
  1965.  SA_Colors   =    (SA_Dummy + $0009);
  1966.                         { ti_Data is an array of struct ColorSpec,
  1967.                          * terminated by ColorIndex = -1.  Specifies
  1968.                          * initial screen palette colors.
  1969.                          }
  1970.  SA_ErrorCode=    (SA_Dummy + $000A);
  1971.                         { ti_Data points to LONG error code (values below)}
  1972.  SA_Font     =    (SA_Dummy + $000B);
  1973.                         { equiv. to NewScreen.Font                     }
  1974.  SA_SysFont  =    (SA_Dummy + $000C);
  1975.                         { Selects one of the preferences system fonts:
  1976.                          *      0 - old DefaultFont, fixed-width
  1977.                          *      1 - WB Screen preferred font
  1978.                          }
  1979.  SA_Type     =    (SA_Dummy + $000D);
  1980.                         { equiv. to NewScreen.Type                     }
  1981.  SA_BitMap   =    (SA_Dummy + $000E);
  1982.                         { ti_Data is pointer to custom BitMap.  This
  1983.                          * implies type of CUSTOMBITMAP
  1984.                          }
  1985.  SA_PubName  =    (SA_Dummy + $000F);
  1986.                         { presence of this tag means that the screen
  1987.                          * is to be a public screen.  Please specify
  1988.                          * BEFORE the two tags below
  1989.                          }
  1990.  SA_PubSig   =    (SA_Dummy + $0010);
  1991.  SA_PubTask  =    (SA_Dummy + $0011);
  1992.                         { Task ID and signal for being notified that
  1993.                          * the last window has closed on a public screen.
  1994.                          }
  1995.  SA_DisplayID=    (SA_Dummy + $0012);
  1996.                         { ti_Data is new extended display ID from
  1997.                          * <graphics/displayinfo.h>.
  1998.                          }
  1999.  SA_DClip    =    (SA_Dummy + $0013);
  2000.                         { ti_Data points to a rectangle which defines
  2001.                          * screen display clip region
  2002.                          }
  2003.  SA_Overscan =    (SA_Dummy + $0014);
  2004.                         { was S_STDDCLIP.  Set to one of the OSCAN_
  2005.                          * specifiers below to get a system standard
  2006.                          * overscan region for your display clip,
  2007.                          * screen dimensions (unless otherwise specified),
  2008.                          * and automatically centered position (partial
  2009.                          * support only so far).
  2010.                          * If you use this, you shouldn't specify
  2011.                          * SA_DClip.  SA_Overscan is for "standard"
  2012.                          * overscan dimensions, SA_DClip is for
  2013.                          * your custom numeric specifications.
  2014.                          }
  2015.  SA_Obsolete1=    (SA_Dummy + $0015);
  2016.                         { obsolete S_MONITORNAME                       }
  2017.  
  2018. {* booleans *}
  2019.  SA_ShowTitle  =  (SA_Dummy + $0016);
  2020.                         { boolean equivalent to flag SHOWTITLE         }
  2021.  SA_Behind     =  (SA_Dummy + $0017);
  2022.                         { boolean equivalent to flag SCREENBEHIND      }
  2023.  SA_Quiet      =  (SA_Dummy + $0018);
  2024.                         { boolean equivalent to flag SCREENQUIET       }
  2025.  SA_AutoScroll =  (SA_Dummy + $0019);
  2026.                         { boolean equivalent to flag AUTOSCROLL        }
  2027.  SA_Pens       =  (SA_Dummy + $001A);
  2028.                         { pointer to ~0 terminated UWORD array, as
  2029.                          * found in struct DrawInfo
  2030.                          }
  2031.  SA_FullPalette=  (SA_Dummy + $001B);
  2032.                         { boolean: initialize color table to entire
  2033.                          *  preferences palette (32 for V36), rather
  2034.                          * than compatible pens 0-3, 17-19, with
  2035.                          * remaining palette as returned by GetColorMap()
  2036.                          }
  2037.  
  2038.  SA_ColorMapEntries = (SA_Dummy + $001C);
  2039.                         { New for V39:
  2040.                          * Allows you to override the number of entries
  2041.                          * in the ColorMap for your screen.  Intuition
  2042.                          * normally allocates (1<<depth) or 32, whichever
  2043.                          * is more, but you may require even more if you
  2044.                          * use certain V39 graphics.library features
  2045.                          * (eg. palette-banking).
  2046.                          }
  2047.  
  2048.  SA_Parent      = (SA_Dummy + $001D);
  2049.                         { New for V39:
  2050.                          * ti_Data is a pointer to a "parent" screen to
  2051.                          * attach this one to.  Attached screens slide
  2052.                          * and depth-arrange together.
  2053.                          }
  2054.  
  2055.  SA_Draggable   = (SA_Dummy + $001E);
  2056.                         { New for V39:
  2057.                          * Boolean tag allowing non-draggable screens.
  2058.                          * Do not use without good reason!
  2059.                          * (Defaults to TRUE).
  2060.                          }
  2061.  
  2062.  SA_Exclusive   = (SA_Dummy + $001F);
  2063.                         { New for V39:
  2064.                          * Boolean tag allowing screens that won't share
  2065.                          * the display.  Use sparingly!  Starting with 3.01,
  2066.                          * attached screens may be SA_Exclusive.  Setting
  2067.                          * SA_Exclusive for each screen will produce an
  2068.                          * exclusive family.   (Defaults to FALSE).
  2069.                          }
  2070.  
  2071.  SA_SharePens   = (SA_Dummy + $0020);
  2072.                         { New for V39:
  2073.                          * For those pens in the screen's DrawInfo->dri_Pens,
  2074.                          * Intuition obtains them in shared mode (see
  2075.                          * graphics.library/ObtainPen()).  For compatibility,
  2076.                          * Intuition obtains the other pens of a public
  2077.                          * screen as PEN_EXCLUSIVE.  Screens that wish to
  2078.                          * manage the pens themselves should generally set
  2079.                          * this tag to TRUE.  This instructs Intuition to
  2080.                          * leave the other pens unallocated.
  2081.                          }
  2082.  
  2083.  SA_BackFill    = (SA_Dummy + $0021);
  2084.                         { New for V39:
  2085.                          * provides a "backfill hook" for your screen's
  2086.                          * Layer_Info.
  2087.                          * See layers.library/InstallLayerInfoHook()
  2088.                          }
  2089.  
  2090.  SA_Interleaved = (SA_Dummy + $0022);
  2091.                         { New for V39:
  2092.                          * Boolean tag requesting that the bitmap
  2093.                          * allocated for you be interleaved.
  2094.                          * (Defaults to FALSE).
  2095.                          }
  2096.  
  2097.  SA_Colors32    = (SA_Dummy + $0023);
  2098.                         { New for V39:
  2099.                          * Tag to set the screen's initial palette colors
  2100.                          * at 32 bits-per-gun.  ti_Data is a pointer
  2101.                          * to a table to be passed to the
  2102.                          * graphics.library/LoadRGB32() function.
  2103.                          * This format supports both runs of color
  2104.                          * registers and sparse registers.  See the
  2105.                          * autodoc for that function for full details.
  2106.                          * Any color set here has precedence over
  2107.                          * the same register set by SA_Colors.
  2108.                          }
  2109.  
  2110.  SA_VideoControl = (SA_Dummy + $0024);
  2111.                         { New for V39:
  2112.                          * ti_Data is a pointer to a taglist that Intuition
  2113.                          * will pass to graphics.library/VideoControl(),
  2114.                          * upon opening the screen.
  2115.                          }
  2116.  
  2117.  SA_FrontChild  = (SA_Dummy + $0025);
  2118.                         { New for V39:
  2119.                          * ti_Data is a pointer to an already open screen
  2120.                          * that is to be the child of the screen being
  2121.                          * opened.  The child screen will be moved to the
  2122.                          * front of its family.
  2123.                          }
  2124.  
  2125.  SA_BackChild   = (SA_Dummy + $0026);
  2126.                         { New for V39:
  2127.                          * ti_Data is a pointer to an already open screen
  2128.                          * that is to be the child of the screen being
  2129.                          * opened.  The child screen will be moved to the
  2130.                          * back of its family.
  2131.                          }
  2132.  
  2133.  SA_LikeWorkbench     =   (SA_Dummy + $0027);
  2134.                         { New for V39:
  2135.                          * Set ti_Data to 1 to request a screen which
  2136.                          * is just like the Workbench.  This gives
  2137.                          * you the same screen mode, depth, size,
  2138.                          * colors, etc., as the Workbench screen.
  2139.                          }
  2140.  
  2141.  SA_Reserved          =   (SA_Dummy + $0028);
  2142.                         { Reserved for private Intuition use }
  2143.  
  2144.  SA_MinimizeISG       =   (SA_Dummy + $0029);
  2145.                         { New for V40:
  2146.                          * For compatibility, Intuition always ensures
  2147.                          * that the inter-screen gap is at least three
  2148.                          * non-interlaced lines.  If your application
  2149.                          * would look best with the smallest possible
  2150.                          * inter-screen gap, set ti_Data to TRUE.
  2151.                          * If you use the new graphics VideoControl()
  2152.                          * VC_NoColorPaletteLoad tag for your screen's
  2153.                          * ViewPort, you should also set this tag.
  2154.                           }
  2155.  
  2156.  
  2157. { this is an obsolete tag included only for compatibility with V35
  2158.  * interim release for the A2024 and Viking monitors
  2159.  }
  2160.  NSTAG_EXT_VPMODE = (TAG_USER + 1);
  2161.  
  2162.  
  2163. { OpenScreen error codes, which are returned in the (optional) LONG
  2164.  * pointed to by ti_Data for the SA_ErrorCode tag item
  2165.  }
  2166.  OSERR_NOMONITOR   = (1);     { named monitor spec not available     }
  2167.  OSERR_NOCHIPS     = (2);     { you need newer custom chips          }
  2168.  OSERR_NOMEM       = (3);     { couldn't get normal memory           }
  2169.  OSERR_NOCHIPMEM   = (4);     { couldn't get chipmem                 }
  2170.  OSERR_PUBNOTUNIQUE= (5);     { public screen name already used      }
  2171.  OSERR_UNKNOWNMODE = (6);     { don't recognize mode asked for       }
  2172.  
  2173. { ======================================================================== }
  2174. { === NewScreen ========================================================== }
  2175. { ======================================================================== }
  2176.  
  2177. Type
  2178.  
  2179.     pNewScreen = ^tNewScreen;
  2180.     tNewScreen = record
  2181.         LeftEdge,
  2182.         TopEdge,
  2183.         Width,
  2184.         Height,
  2185.         Depth           : Integer;        { screen dimensions }
  2186.  
  2187.         DetailPen,
  2188.         BlockPen        : Byte;         { for bar/border/gadget rendering }
  2189.  
  2190.         ViewModes       : Word;        { the Modes for the ViewPort (and View) }
  2191.  
  2192.         SType           : Word;        { the Screen type (see defines above) }
  2193.  
  2194.         Font            : pTextAttr;  { this Screen's default text attributes }
  2195.  
  2196.         DefaultTitle    : STRPTR;       { the default title for this Screen }
  2197.  
  2198.         Gadgets         : pGadget;      { your own Gadgets for this Screen }
  2199.  
  2200.     { if you are opening a CUSTOMSCREEN and already have a BitMap
  2201.      * that you want used for your Screen, you set the flags CUSTOMBITMAP in
  2202.      * the Type field and you set this variable to point to your BitMap
  2203.      * structure.  The structure will be copied into your Screen structure,
  2204.      * after which you may discard your own BitMap if you want
  2205.      }
  2206.  
  2207.         CustomBitMap    : pBitMap;
  2208.     end;
  2209.  
  2210.  
  2211. type
  2212.  
  2213.  pExtNewScreen = ^tExtNewScreen;
  2214.  tExtNewScreen = record
  2215.   LeftEdge, TopEdge, Width, Height, Depth : Integer;
  2216.   DetailPen, BlockPen : Byte;
  2217.   ViewModes : Word;
  2218.   ens_Type : Word;     { Type in C-Includes }
  2219.   Font : pTextAttr;
  2220.   DefaultTitle : STRPTR;
  2221.   Gadgets : pGadget;
  2222.   CustomBitMap : pBitMap;
  2223.   Extension : pTagItem;
  2224.  END;
  2225.  
  2226.  
  2227. CONST
  2228. { === Overscan Types ===       }
  2229.  OSCAN_TEXT     = (1);     { entirely visible     }
  2230.  OSCAN_STANDARD = (2);     { just past edges      }
  2231.  OSCAN_MAX      = (3);     { as much as possible  }
  2232.  OSCAN_VIDEO    = (4);     { even more than is possible   }
  2233.  
  2234.  
  2235. { === Public Shared Screen Node ===    }
  2236.  
  2237. { This is the representative of a public shared screen.
  2238.  * This is an internal data structure, but some functions may
  2239.  * present a copy of it to the calling application.  In that case,
  2240.  * be aware that the screen pointer of the structure can NOT be
  2241.  * used safely, since there is no guarantee that the referenced
  2242.  * screen will remain open and a valid data structure.
  2243.  *
  2244.  * Never change one of these.
  2245.  }
  2246.  
  2247. Type
  2248.    pPubScreenNode = ^tPubScreenNode;
  2249.    tPubScreenNode = record
  2250.     psn_Node    : tNode;       { ln_Name is screen name }
  2251.     psn_Screen  : pScreen;
  2252.     psn_Flags   : Word;      { below                }
  2253.     psn_Size    : Integer;      { includes name buffer }
  2254.     psn_VisitorCount  : Integer; { how many visitor windows }
  2255.     psn_SigTask : pTask;    { who to signal when visitors gone }
  2256.     psn_SigBit  : Byte;     { which signal }
  2257.    END;
  2258.  
  2259. CONST
  2260.  PSNF_PRIVATE  =  ($0001);
  2261.  
  2262.  MAXPUBSCREENNAME  =      (139);   { names no longer, please      }
  2263.  
  2264. { pub screen modes     }
  2265.  SHANGHAI      =  $0001;  { put workbench windows on pub screen }
  2266.  POPPUBSCREEN  =  $0002;  { pop pub screen to front when visitor opens }
  2267.  
  2268. { New for V39:  Intuition has new screen depth-arrangement and movement
  2269.  * functions called ScreenDepth() and ScreenPosition() respectively.
  2270.  * These functions permit the old behavior of ScreenToFront(),
  2271.  * ScreenToBack(), and MoveScreen().  ScreenDepth() also allows
  2272.  * independent depth control of attached screens.  ScreenPosition()
  2273.  * optionally allows positioning screens even though they were opened
  2274.  * (SA_Draggable,FALSE).
  2275.  }
  2276.  
  2277. { For ScreenDepth(), specify one of SDEPTH_TOFRONT or SDEPTH_TOBACK,
  2278.  * and optionally also SDEPTH_INFAMILY.
  2279.  *
  2280.  * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  2281.  * SDEPTH_INFAMILY.  Commodities, "input helper" programs,
  2282.  * or any other program that did not open a screen should never
  2283.  * use that flag.  (Note that this is a style-behavior
  2284.  * requirement;  there is no technical requirement that the
  2285.  * task calling this function need be the task which opened
  2286.  * the screen).
  2287.  }
  2288.  
  2289.  SDEPTH_TOFRONT        =  (0);     { Bring screen to front }
  2290.  SDEPTH_TOBACK         =  (1);     { Send screen to back }
  2291.  SDEPTH_INFAMILY       =  (2);     { Move an attached screen with
  2292.                                          * respect to other screens of
  2293.                                          * its family
  2294.                                          }
  2295.  
  2296. { Here's an obsolete name equivalent to SDEPTH_INFAMILY: }
  2297.  SDEPTH_CHILDONLY      =  SDEPTH_INFAMILY;
  2298.  
  2299.  
  2300. { For ScreenPosition(), specify one of SPOS_RELATIVE, SPOS_ABSOLUTE,
  2301.  * or SPOS_MAKEVISIBLE to describe the kind of screen positioning you
  2302.  * wish to perform:
  2303.  *
  2304.  * SPOS_RELATIVE: The x1 and y1 parameters to ScreenPosition() describe
  2305.  *      the offset in coordinates you wish to move the screen by.
  2306.  * SPOS_ABSOLUTE: The x1 and y1 parameters to ScreenPosition() describe
  2307.  *      the absolute coordinates you wish to move the screen to.
  2308.  * SPOS_MAKEVISIBLE: (x1,y1)-(x2,y2) describes a rectangle on the
  2309.  *      screen which you would like autoscrolled into view.
  2310.  *
  2311.  * You may additionally set SPOS_FORCEDRAG along with any of the
  2312.  * above.  Set this if you wish to reposition an (SA_Draggable,FALSE)
  2313.  * screen that you opened.
  2314.  *
  2315.  * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  2316.  * SPOS_FORCEDRAG.  Commodities, "input helper" programs,
  2317.  * or any other program that did not open a screen should never
  2318.  * use that flag.
  2319.  }
  2320.  
  2321.  SPOS_RELATIVE         =  (0);     { Coordinates are relative }
  2322.  
  2323.  SPOS_ABSOLUTE         =  (1);     { Coordinates are expressed as
  2324.                                          * absolutes, not relatives.
  2325.                                          }
  2326.  
  2327.  SPOS_MAKEVISIBLE      =  (2);     { Coordinates describe a box on
  2328.                                          * the screen you wish to be
  2329.                                          * made visible by autoscrolling
  2330.                                          }
  2331.  
  2332.  SPOS_FORCEDRAG        =  (4);     { Move non-draggable screen }
  2333.  
  2334. { New for V39: Intuition supports double-buffering in screens,
  2335.  * with friendly interaction with menus and certain gadgets.
  2336.  * For each buffer, you need to get one of these structures
  2337.  * from the AllocScreenBuffer() call.  Never allocate your
  2338.  * own ScreenBuffer structures!
  2339.  *
  2340.  * The sb_DBufInfo field is for your use.  See the graphics.library
  2341.  * AllocDBufInfo() autodoc for details.
  2342.  }
  2343. Type
  2344.  
  2345.  pScreenBuffer = ^tScreenBuffer;
  2346.  tScreenBuffer = record
  2347.     sb_BitMap  : pBitMap;           { BitMap of this buffer }
  2348.     sb_DBufInfo : pDBufInfo;       { DBufInfo for this buffer }
  2349.  end;
  2350.  
  2351. const
  2352. { These are the flags that may be passed to AllocScreenBuffer().
  2353.  }
  2354.  SB_SCREEN_BITMAP      =  1;
  2355.  SB_COPY_BITMAP        =  2;
  2356.  
  2357.  
  2358. { ======================================================================== }
  2359. { === Preferences ======================================================== }
  2360. { ======================================================================== }
  2361.  
  2362. Const
  2363.  
  2364. { these are the definitions for the printer configurations }
  2365.     FILENAME_SIZE       = 30;           { Filename size }
  2366.  
  2367.     POINTERSIZE         = (1 + 16 + 1) * 2;     { Size of Pointer data buffer }
  2368.  
  2369. { These defines are for the default font size.   These actually describe the
  2370.  * height of the defaults fonts.  The default font type is the topaz
  2371.  * font, which is a fixed width font that can be used in either
  2372.  * eighty-column or sixty-column mode.  The Preferences structure reflects
  2373.  * which is currently selected by the value found in the variable FontSize,
  2374.  * which may have either of the values defined below.  These values actually
  2375.  * are used to select the height of the default font.  By changing the
  2376.  * height, the resolution of the font changes as well.
  2377.  }
  2378.     TOPAZ_EIGHTY        = 8;
  2379.     TOPAZ_SIXTY         = 9;
  2380.  
  2381. Type
  2382.  
  2383.     pPreferences = ^tPreferences;
  2384.     tPreferences = record
  2385.     { the default font height }
  2386.         FontHeight      : Shortint;         { height for system default font  }
  2387.  
  2388.     { constant describing what's hooked up to the port }
  2389.         PrinterPort     : Byte;         { printer port connection     }
  2390.  
  2391.     { the baud rate of the port }
  2392.         BaudRate        : Word;        { baud rate for the serial port   }
  2393.  
  2394.     { various timing rates }
  2395.         KeyRptSpeed     : ttimeval;      { repeat speed for keyboard       }
  2396.         KeyRptDelay     : ttimeval;      { Delay before keys repeat             }
  2397.         DoubleClick     : ttimeval;      { Interval allowed between clicks }
  2398.  
  2399.     { Intuition Pointer data }
  2400.         PointerMatrix   : Array [0..POINTERSIZE-1] of Word;
  2401.                                         { Definition of pointer sprite     }
  2402.         XOffset         : Shortint;         { X-Offset for active 'bit'       }
  2403.         YOffset         : Shortint;         { Y-Offset for active 'bit'       }
  2404.         color17         : Word;        {*********************************}
  2405.         color18         : Word;        { Colours for sprite pointer      }
  2406.         color19         : Word;        {*********************************}
  2407.         PointerTicks    : Word;        { Sensitivity of the pointer       }
  2408.  
  2409.     { Workbench Screen colors }
  2410.         color0          : Word;        {*********************************}
  2411.         color1          : Word;        {   Standard default colours      }
  2412.         color2          : Word;        {   Used in the Workbench         }
  2413.         color3          : Word;        {*********************************}
  2414.  
  2415.     { positioning data for the Intuition View }
  2416.         ViewXOffset     : Shortint;         { Offset for top lefthand corner  }
  2417.         ViewYOffset     : Shortint;         { X and Y dimensions           }
  2418.         ViewInitX,
  2419.         ViewInitY       : Integer;        { View initial offset values      }
  2420.  
  2421.         EnableCLI       : Boolean;      { CLI availability switch }
  2422.  
  2423.     { printer configurations }
  2424.         PrinterType     : Word;        { printer type                     }
  2425.         PrinterFilename : Array [0..FILENAME_SIZE-1] of Char;
  2426.                                         { file for printer         }
  2427.  
  2428.     { print format and quality configurations }
  2429.         PrintPitch      : Word;        { print pitch              }
  2430.         PrintQuality    : Word;        { print quality    }
  2431.         PrintSpacing    : Word;        { number of lines per inch    }
  2432.         PrintLeftMargin : Word;        { left margin in characters        }
  2433.         PrintRightMargin : Word;       { right margin in characters       }
  2434.         PrintImage      : Word;        { positive or negative         }
  2435.         PrintAspect     : Word;        { horizontal or vertical      }
  2436.         PrintShade      : Word;        { b&w, half-tone, or color    }
  2437.         PrintThreshold  : Integer;        { darkness ctrl for b/w dumps      }
  2438.  
  2439.     { print paper descriptors }
  2440.         PaperSize       : Word;        { paper size               }
  2441.         PaperLength     : Word;        { paper length in number of lines }
  2442.         PaperType       : Word;        { continuous or single sheet       }
  2443.  
  2444.     { Serial device settings: These are six nibble-fields in three bytes }
  2445.     { (these look a little strange so the defaults will map out to zero) }
  2446.         SerRWBits       : Byte;
  2447.                              { upper nibble = (8-number of read bits)     }
  2448.                              { lower nibble = (8-number of write bits)    }
  2449.         SerStopBuf      : Byte;
  2450.                              { upper nibble = (number of stop bits - 1)  }
  2451.                              { lower nibble = (table value for BufSize)  }
  2452.         SerParShk       : Byte;
  2453.                              { upper nibble = (value for Parity setting) }
  2454.                              { lower nibble = (value for Handshake mode) }
  2455.         LaceWB          : Byte;         { if workbench is to be interlaced      }
  2456.  
  2457.         WorkName        : Array [0..FILENAME_SIZE-1] of Char;
  2458.                                         { temp file for printer         }
  2459.  
  2460.         RowSizeChange   : Shortint;
  2461.         ColumnSizeChange : Shortint;
  2462.  
  2463.         PrintFlags      : Word;        { user preference flags }
  2464.         PrintMaxWidth   : Word;        { max width of printed picture in 10ths/inch }
  2465.         PrintMaxHeight  : Word;        { max height of printed picture in 10ths/inch }
  2466.         PrintDensity    : Byte;         { print density }
  2467.         PrintXOffset    : Byte;         { offset of printed picture in 10ths/inch }
  2468.  
  2469.         wb_Width        : Word;        { override default workbench width       }
  2470.         wb_Height       : Word;        { override default workbench height }
  2471.         wb_Depth        : Byte;         { override default workbench depth       }
  2472.  
  2473.         ext_size        : Byte;         { extension information -- do not touch! }
  2474.                             { extension size in blocks of 64 bytes }
  2475.     end;
  2476.  
  2477. Const
  2478.  
  2479. { Workbench Interlace (use one bit) }
  2480.     LACEWB              = $01;
  2481.     LW_RESERVED         = 1;     { internal use only }
  2482.  
  2483. { PrinterPort }
  2484.     PARALLEL_PRINTER    = $00;
  2485.     SERIAL_PRINTER      = $01;
  2486.  
  2487. { BaudRate }
  2488.     BAUD_110            = $00;
  2489.     BAUD_300            = $01;
  2490.     BAUD_1200           = $02;
  2491.     BAUD_2400           = $03;
  2492.     BAUD_4800           = $04;
  2493.     BAUD_9600           = $05;
  2494.     BAUD_19200          = $06;
  2495.     BAUD_MIDI           = $07;
  2496.  
  2497. { PaperType }
  2498.     FANFOLD             = $00;
  2499.     SINGLE              = $80;
  2500.  
  2501. { PrintPitch }
  2502.     PICA                = $000;
  2503.     ELITE               = $400;
  2504.     FINE                = $800;
  2505.  
  2506. { PrintQuality }
  2507.     DRAFT               = $000;
  2508.     LETTER              = $100;
  2509.  
  2510. { PrintSpacing }
  2511.     SIX_LPI             = $000;
  2512.     EIGHT_LPI           = $200;
  2513.  
  2514. { Print Image }
  2515.     IMAGE_POSITIVE      = $00;
  2516.     IMAGE_NEGATIVE      = $01;
  2517.  
  2518. { PrintAspect }
  2519.     ASPECT_HORIZ        = $00;
  2520.     ASPECT_VERT         = $01;
  2521.  
  2522. { PrintShade }
  2523.     SHADE_BW            = $00;
  2524.     SHADE_GREYSCALE     = $01;
  2525.     SHADE_COLOR         = $02;
  2526.  
  2527. { PaperSize }
  2528.     US_LETTER           = $00;
  2529.     US_LEGAL            = $10;
  2530.     N_TRACTOR           = $20;
  2531.     W_TRACTOR           = $30;
  2532.     CUSTOM_PAPER        = $40;
  2533.  
  2534. { New PaperSizes for V36: }
  2535.  EURO_A0 = $50;            { European size A0: 841 x 1189 }
  2536.  EURO_A1 = $60;            { European size A1: 594 x 841 }
  2537.  EURO_A2 = $70;            { European size A2: 420 x 594 }
  2538.  EURO_A3 = $80;            { European size A3: 297 x 420 }
  2539.  EURO_A4 = $90;            { European size A4: 210 x 297 }
  2540.  EURO_A5 = $A0;            { European size A5: 148 x 210 }
  2541.  EURO_A6 = $B0;            { European size A6: 105 x 148 }
  2542.  EURO_A7 = $C0;            { European size A7: 74 x 105 }
  2543.  EURO_A8 = $D0;            { European size A8: 52 x 74 }
  2544.  
  2545. { PrinterType }
  2546.     CUSTOM_NAME         = $00;
  2547.     ALPHA_P_101         = $01;
  2548.     BROTHER_15XL        = $02;
  2549.     CBM_MPS1000         = $03;
  2550.     DIAB_630            = $04;
  2551.     DIAB_ADV_D25        = $05;
  2552.     DIAB_C_150          = $06;
  2553.     EPSON               = $07;
  2554.     EPSON_JX_80         = $08;
  2555.     OKIMATE_20          = $09;
  2556.     QUME_LP_20          = $0A;
  2557. { new printer entries, 3 October 1985 }
  2558.     HP_LASERJET         = $0B;
  2559.     HP_LASERJET_PLUS    = $0C;
  2560.  
  2561. { Serial Input Buffer Sizes }
  2562.     SBUF_512            = $00;
  2563.     SBUF_1024           = $01;
  2564.     SBUF_2048           = $02;
  2565.     SBUF_4096           = $03;
  2566.     SBUF_8000           = $04;
  2567.     SBUF_16000          = $05;
  2568.  
  2569. { Serial Bit Masks }
  2570.     SREAD_BITS          = $F0;          { for SerRWBits   }
  2571.     SWRITE_BITS         = $0F;
  2572.  
  2573.     SSTOP_BITS          = $F0;          { for SerStopBuf  }
  2574.     SBUFSIZE_BITS       = $0F;
  2575.  
  2576.     SPARITY_BITS        = $F0;          { for SerParShk }
  2577.     SHSHAKE_BITS        = $0F;
  2578.  
  2579. { Serial Parity (upper nibble, after being shifted by
  2580.  * macro SPARNUM() )
  2581.  }
  2582.     SPARITY_NONE        = 0;
  2583.     SPARITY_EVEN        = 1;
  2584.     SPARITY_ODD         = 2;
  2585.  
  2586. { Serial Handshake Mode (lower nibble, after masking using
  2587.  * macro SHANKNUM() )
  2588.  }
  2589.     SHSHAKE_XON         = 0;
  2590.     SHSHAKE_RTS         = 1;
  2591.     SHSHAKE_NONE        = 2;
  2592.  
  2593. { new defines for PrintFlags }
  2594.  
  2595.     CORRECT_RED         = $0001;        { color correct red shades }
  2596.     CORRECT_GREEN       = $0002;        { color correct green shades }
  2597.     CORRECT_BLUE        = $0004;        { color correct blue shades }
  2598.  
  2599.     CENTER_IMAGE        = $0008;        { center image on paper }
  2600.  
  2601.     IGNORE_DIMENSIONS   = $0000;        { ignore max width/height settings }
  2602.     BOUNDED_DIMENSIONS  = $0010;        { use max width/height as boundaries }
  2603.     ABSOLUTE_DIMENSIONS = $0020;        { use max width/height as absolutes }
  2604.     PIXEL_DIMENSIONS    = $0040;        { use max width/height as prt pixels }
  2605.     MULTIPLY_DIMENSIONS = $0080;        { use max width/height as multipliers }
  2606.  
  2607.     INTEGER_SCALING     = $0100;        { force integer scaling }
  2608.  
  2609.     ORDERED_DITHERING   = $0000;        { ordered dithering }
  2610.     HALFTONE_DITHERING  = $0200;        { halftone dithering }
  2611.     FLOYD_DITHERING     = $0400;        { Floyd-Steinberg dithering }
  2612.  
  2613.     ANTI_ALIAS          = $0800;        { anti-alias image }
  2614.     GREY_SCALE2         = $1000;        { for use with hi-res monitor }
  2615.  
  2616. { masks used for checking bits }
  2617.  
  2618.     CORRECT_RGB_MASK    = CORRECT_RED + CORRECT_GREEN + CORRECT_BLUE;
  2619.     DIMENSIONS_MASK     = BOUNDED_DIMENSIONS + ABSOLUTE_DIMENSIONS +
  2620.                                 PIXEL_DIMENSIONS + MULTIPLY_DIMENSIONS;
  2621.     DITHERING_MASK      = HALFTONE_DITHERING + FLOYD_DITHERING;
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628. { ======================================================================== }
  2629. { === IntuitionBase ====================================================== }
  2630. { ======================================================================== }
  2631. {
  2632.  * Be sure to protect yourself against someone modifying these data as
  2633.  * you look at them.  This is done by calling:
  2634.  *
  2635.  * lock = LockIBase(0), which returns an Integer.  When done call
  2636.  * UnlockIBase(lock) where lock is what LockIBase() returned.
  2637.  }
  2638.  
  2639. Type
  2640.  
  2641.     pIntuitionBase = ^tIntuitionBase;
  2642.     tIntuitionBase = record
  2643. { IntuitionBase should never be directly modified by programs   }
  2644. { even a little bit, guys/gals; do you hear me? }
  2645.  
  2646.         LibNode         : tLibrary;
  2647.  
  2648.         ViewLord        : tView;
  2649.  
  2650.         ActiveWindow    : pWindow;
  2651.         ActiveScreen    : pScreen;
  2652.  
  2653.     { the FirstScreen variable points to the frontmost Screen.   Screens are
  2654.      * then maintained in a front to back order using Screen.NextScreen
  2655.      }
  2656.  
  2657.         FirstScreen     : pScreen;    { for linked list of all screens }
  2658.  
  2659.         Flags           : ULONG;      { see definitions below }
  2660.         MouseY,
  2661.         MouseX          : Integer;        { mouse position relative to View }
  2662.  
  2663.         Seconds         : ULONG;      { timestamp of most current input event }
  2664.         Micros          : ULONG;      { timestamp of most current input event }
  2665.  
  2666.     { I told you this was private.
  2667.      * The data beyond this point has changed, is changing, and
  2668.      * will continue to change.
  2669.      }
  2670.  
  2671.     end;
  2672.  
  2673.  
  2674. {
  2675.  * Package of information passed to custom and 'boopsi'
  2676.  * gadget 'hook' functions.  This structure is READ ONLY.
  2677.  }
  2678. Type
  2679.  
  2680.    pGadgetInfo = ^tGadgetInfo;
  2681.    tGadgetInfo = record
  2682.     gi_Screen                   : pScreen;       { ScreenPtr }
  2683.     gi_Window                   : pWindow;       { null for screen gadgets }    { WindowPtr }
  2684.     gi_Requester                : pRequester;    { null IF not GTYP_REQGADGET } { RequesterPtr }
  2685.  
  2686.     { rendering information:
  2687.      * don't use these without cloning/locking.
  2688.      * Official way is to call ObtainRPort()
  2689.      }
  2690.     gi_RastPort                 : pRastPort;     { RastPortPtr }
  2691.     gi_Layer                    : pLayer;        { LayerPtr }
  2692.  
  2693.     { copy of dimensions of screen/window/g00/req(/group)
  2694.      * that gadget resides in.  Left/Top of this box is
  2695.      * offset from window mouse coordinates to gadget coordinates
  2696.      *          screen gadgets:                 0,0 (from screen coords)
  2697.      *  window gadgets (no g00):        0,0
  2698.      *  GTYP_GZZGADGETs (borderlayer):          0,0
  2699.      *  GZZ innerlayer gadget:          borderleft, bordertop
  2700.      *  Requester gadgets:              reqleft, reqtop
  2701.      }
  2702.     gi_Domain                   : tIBox;
  2703.  
  2704.     gi_Pens                     : record
  2705.                       DetailPen : Byte;
  2706.                       BlockPen  : Byte;
  2707.                                   end;
  2708.  
  2709.     { the Detail and Block pens in gi_DrInfo->dri_Pens[] are
  2710.      * for the screen.  Use the above for window-sensitive
  2711.      * colors.
  2712.      }
  2713.     gi_DrInfo                   : pDrawInfo;  { DrawInfoPtr }
  2714.  
  2715.     { reserved space: this structure is extensible
  2716.      * anyway, but using these saves some recompilation
  2717.      }
  2718.     gi_Reserved                 : Array[0..5] of ULONG;
  2719.    END;
  2720.  
  2721. {** system private data structure for now **}
  2722. { prop gadget extra info       }
  2723.  
  2724.    pPGX = ^tPGX;
  2725.    tPGX = record
  2726.     pgx_Container : tIBox;
  2727.     pgx_NewKnob   : tIBox;
  2728.    END;
  2729.  
  2730. { this casts MutualExclude for easy assignment of a hook
  2731.  * pointer to the unused MutualExclude field of a custom gadget
  2732.  }
  2733.  
  2734. {** User visible handles on objects, classes, messages **}
  2735. Type
  2736.  Object_ = ULONG;
  2737.  pObject_ = ^Object_;
  2738.  ClassID = ^Byte;
  2739.  
  2740. {
  2741.  you can use this type to point to a 'generic' message,
  2742.  * in the object-oriented programming parlance.  Based on
  2743.  * the value of 'MethodID', you dispatch to processing
  2744.  * for the various message types.  The meaningful parameter
  2745.  * packet structure definitions are defined below.
  2746.  
  2747. typedef struct
  2748.     ULONG MethodID;
  2749.      method-specific data follows, some examples below
  2750.                *Msg; }
  2751.  
  2752.   pMsg = ^tMsg;
  2753.   tMsg = record
  2754.      MethodID : ULONG;
  2755.   end;
  2756.  
  2757. {
  2758.  * Class id strings for Intuition classes.
  2759.  * There's no real reason to use the uppercase constants
  2760.  * over the lowercase strings, but this makes a good place
  2761.  * to list the names of the built-in classes.
  2762.  }
  2763. CONST
  2764.  ROOTCLASS      : PChar = 'rootclass'    ;         { classusr.h   }
  2765.  IMAGECLASS     : PChar = 'imageclass'   ;         { imageclass.h }
  2766.  FRAMEICLASS    : PChar = 'frameiclass'  ;
  2767.  SYSICLASS      : PChar = 'sysiclass'    ;
  2768.  FILLRECTCLASS  : PChar = 'fillrectclass';
  2769.  GADGETCLASS    : PChar = 'gadgetclass'  ;         { gadgetclass.h }
  2770.  PROPGCLASS     : PChar = 'propgclass'   ;
  2771.  STRGCLASS      : PChar = 'strgclass'    ;
  2772.  BUTTONGCLASS   : PChar = 'buttongclass' ;
  2773.  FRBUTTONCLASS  : PChar = 'frbuttonclass';
  2774.  GROUPGCLASS    : PChar = 'groupgclass'  ;
  2775.  ICCLASS        : PChar = 'icclass'      ;         { icclass.h    }
  2776.  MODELCLASS     : PChar = 'modelclass'   ;
  2777.  ITEXTICLASS    : PChar = 'itexticlass'  ;
  2778.  POINTERCLASS   : PChar = 'pointerclass' ;         { pointerclass.h }
  2779.  
  2780.  
  2781. { Dispatched method ID's
  2782.  * NOTE: Applications should use Intuition entry points, not direct
  2783.  * DoMethod() calls, for NewObject, DisposeObject, SetAttrs,
  2784.  * SetGadgetAttrs, and GetAttr.
  2785.  }
  2786.  
  2787.  OM_Dummy       = ($100);
  2788.  OM_NEW         = ($101); { 'object' parameter is 'true class'   }
  2789.  OM_DISPOSE     = ($102); { delete self (no parameters)          }
  2790.  OM_SET         = ($103); { set attributes (in tag list)         }
  2791.  OM_GET         = ($104); { return single attribute value        }
  2792.  OM_ADDTAIL     = ($105); { add self to a List (let root do it)  }
  2793.  OM_REMOVE      = ($106); { remove self from list                }
  2794.  OM_NOTIFY      = ($107); { send to self: notify dependents      }
  2795.  OM_UPDATE      = ($108); { notification message from somebody   }
  2796.  OM_ADDMEMBER   = ($109); { used by various classes with lists   }
  2797.  OM_REMMEMBER   = ($10A); { used by various classes with lists   }
  2798.  
  2799. { Parameter 'Messages' passed to methods       }
  2800.  
  2801. { OM_NEW and OM_SET    }
  2802. Type
  2803.    popSet = ^topSet;
  2804.    topSet = record
  2805.     MethodID            : ULONG;
  2806.     ops_AttrList        : pTagItem;    { new attributes       }
  2807.     ops_GInfo           : pGadgetInfo; { always there for gadgets,
  2808.                                          * when SetGadgetAttrs() is used,
  2809.                                          * but will be NULL for OM_NEW
  2810.                                          }
  2811.    END;
  2812.  
  2813. { OM_NOTIFY, and OM_UPDATE     }
  2814.  
  2815.   popUpdate = ^topUpdate;
  2816.   topUpdate = record
  2817.     MethodID            : ULONG;
  2818.     opu_AttrList        : pTagItem;     { new attributes       }
  2819.     opu_GInfo           : pGadgetInfo;  { non-NULL when SetGadgetAttrs OR
  2820.                                          * notification resulting from gadget
  2821.                                          * input occurs.
  2822.                                          }
  2823.     opu_Flags           : ULONG;        { defined below        }
  2824.   END;
  2825.  
  2826. { this flag means that the update message is being issued from
  2827.  * something like an active gadget, a la GACT_FOLLOWMOUSE.  When
  2828.  * the gadget goes inactive, it will issue a final update
  2829.  * message with this bit cleared.  Examples of use are for
  2830.  * GACT_FOLLOWMOUSE equivalents for propgadclass, and repeat strobes
  2831.  * for buttons.
  2832.  }
  2833. CONST
  2834.  OPUF_INTERIM   = 1;
  2835.  
  2836. { OM_GET       }
  2837. Type
  2838.  
  2839.   popGet = ^topGet;
  2840.   topGet = record
  2841.     MethodID,
  2842.     opg_AttrID          : ULONG;
  2843.     opg_Storage         : Pointer;   { may be other types, but 'int'
  2844.                                          * types are all ULONG
  2845.                                          }
  2846.   END;
  2847.  
  2848. { OM_ADDTAIL   }
  2849.  
  2850.   popAddTail = ^topAddTail;
  2851.   topAddTail = record
  2852.     MethodID  : ULONG;
  2853.     opat_List : pList;
  2854.   END;
  2855.  
  2856. { OM_ADDMEMBER, OM_REMMEMBER   }
  2857. Type
  2858.  
  2859.    popMember = ^topMember;
  2860.    topMember = record
  2861.     MethodID   : ULONG;
  2862.     opam_Object : pObject_;
  2863.    END;
  2864.  
  2865.  
  2866.  
  2867. {*****************************************}
  2868. {** 'White box' access to struct IClass **}
  2869. {*****************************************}
  2870.  
  2871. { This structure is READ-ONLY, and allocated only by Intuition }
  2872. TYPE
  2873.  
  2874.    pIClass = ^tIClass;
  2875.    tIClass = record
  2876.     cl_Dispatcher       : tHook;
  2877.     cl_Reserved         : ULONG;    { must be 0  }
  2878.     cl_Super            : pIClass;
  2879.     cl_ID               : ClassID;
  2880.  
  2881.     { where within an object is the instance data for this class? }
  2882.     cl_InstOffset       : Word;
  2883.     cl_InstSize         : Word;
  2884.  
  2885.     cl_UserData         : ULONG;    { per-class data of your choice }
  2886.     cl_SubclassCount    : ULONG;
  2887.                                         { how many direct subclasses?  }
  2888.     cl_ObjectCount      : ULONG;
  2889.                                 { how many objects created of this class? }
  2890.     cl_Flags            : ULONG;
  2891.    END;
  2892.  
  2893. CONST
  2894.  CLF_INLIST    =  $00000001;      { class is in public class list }
  2895.  
  2896.  
  2897.  
  2898. {************************************************}
  2899. {** 'White box' access to struct _Object       **}
  2900. {************************************************}
  2901.  
  2902. {
  2903.  * We have this, the instance data of the root class, PRECEDING
  2904.  * the 'object'.  This is so that Gadget objects are Gadget pointers,
  2905.  * and so on.  If this structure grows, it will always have o_Class
  2906.  * at the end, so the macro OCLASS(o) will always have the same
  2907.  * offset back from the pointer returned from NewObject().
  2908.  *
  2909.  * This data structure is subject to change.  Do not use the o_Node
  2910.  * embedded structure.
  2911.  }
  2912. Type
  2913.   p_Object = ^t_Object;
  2914.   t_Object = record
  2915.     o_Node    : tMinNode;
  2916.     o_Class   : pIClass;
  2917.   END;
  2918.  
  2919.  
  2920. {
  2921.  * NOTE:  <intuition/iobsolete.h> is included at the END of this file!
  2922.  }
  2923.  
  2924. { Gadget Class attributes      }
  2925. CONST
  2926.     GA_Dummy           =  (TAG_USER +$30000);
  2927.     GA_Left            =  (GA_Dummy + $0001);
  2928.     GA_RelRight        =  (GA_Dummy + $0002);
  2929.     GA_Top             =  (GA_Dummy + $0003);
  2930.     GA_RelBottom       =  (GA_Dummy + $0004);
  2931.     GA_Width           =  (GA_Dummy + $0005);
  2932.     GA_RelWidth        =  (GA_Dummy + $0006);
  2933.     GA_Height          =  (GA_Dummy + $0007);
  2934.     GA_RelHeight       =  (GA_Dummy + $0008);
  2935.     GA_Text            =  (GA_Dummy + $0009); { ti_Data is (UBYTE *) }
  2936.     GA_Image           =  (GA_Dummy + $000A);
  2937.     GA_Border          =  (GA_Dummy + $000B);
  2938.     GA_SelectRender    =  (GA_Dummy + $000C);
  2939.     GA_Highlight       =  (GA_Dummy + $000D);
  2940.     GA_Disabled        =  (GA_Dummy + $000E);
  2941.     GA_GZZGadget       =  (GA_Dummy + $000F);
  2942.     GA_ID              =  (GA_Dummy + $0010);
  2943.     GA_UserData        =  (GA_Dummy + $0011);
  2944.     GA_SpecialInfo     =  (GA_Dummy + $0012);
  2945.     GA_Selected        =  (GA_Dummy + $0013);
  2946.     GA_EndGadget       =  (GA_Dummy + $0014);
  2947.     GA_Immediate       =  (GA_Dummy + $0015);
  2948.     GA_RelVerify       =  (GA_Dummy + $0016);
  2949.     GA_FollowMouse     =  (GA_Dummy + $0017);
  2950.     GA_RightBorder     =  (GA_Dummy + $0018);
  2951.     GA_LeftBorder      =  (GA_Dummy + $0019);
  2952.     GA_TopBorder       =  (GA_Dummy + $001A);
  2953.     GA_BottomBorder    =  (GA_Dummy + $001B);
  2954.     GA_ToggleSelect    =  (GA_Dummy + $001C);
  2955.  
  2956.     { internal use only, until further notice, please }
  2957.     GA_SysGadget       =  (GA_Dummy + $001D);
  2958.         { bool, sets GTYP_SYSGADGET field in type      }
  2959.     GA_SysGType        =  (GA_Dummy + $001E);
  2960.         { e.g., GTYP_WUPFRONT, ...     }
  2961.  
  2962.     GA_Previous        =  (GA_Dummy + $001F);
  2963.         { previous gadget (or (struct Gadget **)) in linked list
  2964.          * NOTE: This attribute CANNOT be used to link new gadgets
  2965.          * into the gadget list of an open window or requester.
  2966.          * You must use AddGList().
  2967.          }
  2968.  
  2969.     GA_Next            =  (GA_Dummy + $0020);
  2970.          { not implemented }
  2971.  
  2972.     GA_DrawInfo        =  (GA_Dummy + $0021);
  2973.         { some fancy gadgets need to see a DrawInfo
  2974.          * when created or for layout
  2975.          }
  2976.  
  2977. { You should use at most ONE of GA_Text, GA_IntuiText, and GA_LabelImage }
  2978.  GA_IntuiText          =  (GA_Dummy + $0022);
  2979.         { ti_Data is (struct IntuiText *) }
  2980.  
  2981.  GA_LabelImage         =  (GA_Dummy + $0023);
  2982.         { ti_Data is an image (object), used in place of
  2983.          * GadgetText
  2984.          }
  2985.  
  2986.  GA_TabCycle           =  (GA_Dummy + $0024);
  2987.         { New for V37:
  2988.          * Boolean indicates that this gadget is to participate in
  2989.          * cycling activation with Tab or Shift-Tab.
  2990.          }
  2991.  
  2992.  GA_GadgetHelp         =  (GA_Dummy + $0025);
  2993.         { New for V39:
  2994.          * Boolean indicates that this gadget sends gadget-help
  2995.          }
  2996.  
  2997.  GA_Bounds             =  (GA_Dummy + $0026);
  2998.         { New for V39:
  2999.          * ti_Data is a pointer to an IBox structure which is
  3000.          * to be copied into the extended gadget's bounds.
  3001.          }
  3002.  
  3003.  GA_RelSpecial         =  (GA_Dummy + $0027);
  3004.         { New for V39:
  3005.          * Boolean indicates that this gadget has the "special relativity"
  3006.          * property, which is useful for certain fancy relativity
  3007.          * operations through the GM_LAYOUT method.
  3008.          }
  3009.  
  3010. { PROPGCLASS attributes }
  3011.  
  3012.  PGA_Dummy      = (TAG_USER + $31000);
  3013.  PGA_Freedom    = (PGA_Dummy + $0001);
  3014.         { only one of FREEVERT or FREEHORIZ }
  3015.  PGA_Borderless = (PGA_Dummy + $0002);
  3016.  PGA_HorizPot   = (PGA_Dummy + $0003);
  3017.  PGA_HorizBody  = (PGA_Dummy + $0004);
  3018.  PGA_VertPot    = (PGA_Dummy + $0005);
  3019.  PGA_VertBody   = (PGA_Dummy + $0006);
  3020.  PGA_Total      = (PGA_Dummy + $0007);
  3021.  PGA_Visible    = (PGA_Dummy + $0008);
  3022.  PGA_Top        = (PGA_Dummy + $0009);
  3023. { New for V37: }
  3024.  PGA_NewLook    = (PGA_Dummy + $000A);
  3025.  
  3026. { STRGCLASS attributes }
  3027.  
  3028.  STRINGA_Dummy         =  (TAG_USER      +$32000);
  3029.  STRINGA_MaxChars      =  (STRINGA_Dummy + $0001);
  3030.  STRINGA_Buffer        =  (STRINGA_Dummy + $0002);
  3031.  STRINGA_UndoBuffer    =  (STRINGA_Dummy + $0003);
  3032.  STRINGA_WorkBuffer    =  (STRINGA_Dummy + $0004);
  3033.  STRINGA_BufferPos     =  (STRINGA_Dummy + $0005);
  3034.  STRINGA_DispPos       =  (STRINGA_Dummy + $0006);
  3035.  STRINGA_AltKeyMap     =  (STRINGA_Dummy + $0007);
  3036.  STRINGA_Font          =  (STRINGA_Dummy + $0008);
  3037.  STRINGA_Pens          =  (STRINGA_Dummy + $0009);
  3038.  STRINGA_ActivePens    =  (STRINGA_Dummy + $000A);
  3039.  STRINGA_EditHook      =  (STRINGA_Dummy + $000B);
  3040.  STRINGA_EditModes     =  (STRINGA_Dummy + $000C);
  3041.  
  3042. { booleans }
  3043.  STRINGA_ReplaceMode    = (STRINGA_Dummy + $000D);
  3044.  STRINGA_FixedFieldMode = (STRINGA_Dummy + $000E);
  3045.  STRINGA_NoFilterMode   = (STRINGA_Dummy + $000F);
  3046.  
  3047.  STRINGA_Justification  = (STRINGA_Dummy + $0010);
  3048.         { GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT }
  3049.  STRINGA_LongVal        = (STRINGA_Dummy + $0011);
  3050.  STRINGA_TextVal        = (STRINGA_Dummy + $0012);
  3051.  
  3052.  STRINGA_ExitHelp       = (STRINGA_Dummy + $0013);
  3053.         { STRINGA_ExitHelp is new for V37, and ignored by V36.
  3054.          * Set this if you want the gadget to exit when Help is
  3055.          * pressed.  Look for a code of $5F, the rawkey code for Help
  3056.          }
  3057.  
  3058.  SG_DEFAULTMAXCHARS     = (128);
  3059.  
  3060. { Gadget Layout related attributes     }
  3061.  
  3062.  LAYOUTA_Dummy          = (TAG_USER  + $38000);
  3063.  LAYOUTA_LayoutObj      = (LAYOUTA_Dummy + $0001);
  3064.  LAYOUTA_Spacing        = (LAYOUTA_Dummy + $0002);
  3065.  LAYOUTA_Orientation    = (LAYOUTA_Dummy + $0003);
  3066.  
  3067. { orientation values   }
  3068.  LORIENT_NONE   = 0;
  3069.  LORIENT_HORIZ  = 1;
  3070.  LORIENT_VERT   = 2;
  3071.  
  3072.  
  3073. { Gadget Method ID's   }
  3074.  
  3075.  GM_Dummy      =  (-1);    { not used for anything                }
  3076.  GM_HITTEST    =  (0);     { return GMR_GADGETHIT IF you are clicked on
  3077.                                  * (whether or not you are disabled).
  3078.                                  }
  3079.  GM_RENDER      = (1);     { draw yourself, in the appropriate state }
  3080.  GM_GOACTIVE    = (2);     { you are now going to be fed input    }
  3081.  GM_HANDLEINPUT = (3);     { handle that input                    }
  3082.  GM_GOINACTIVE  = (4);     { whether or not by choice, you are done  }
  3083.  GM_HELPTEST    = (5);     { Will you send gadget help if the mouse is
  3084.                                  * at the specified coordinates?  See below
  3085.                                  * for possible GMR_ values.
  3086.                                  }
  3087.  GM_LAYOUT      = (6);     { re-evaluate your size based on the GadgetInfo
  3088.                                  * Domain.  Do NOT re-render yourself yet, you
  3089.                                  * will be called when it is time...
  3090.                                  }
  3091.  
  3092. { Parameter "Messages" passed to gadget class methods  }
  3093.  
  3094. { GM_HITTEST   }
  3095. type
  3096.  
  3097.   pgpHitTest = ^tgpHitTest;
  3098.   tgpHitTest = record
  3099.     MethodID  : ULONG;
  3100.     gpht_GInfo : pGadgetInfo;
  3101.     gpht_Mouse : record
  3102.              x : Integer;
  3103.              y : Integer;
  3104.                  end;
  3105.   END;
  3106.  
  3107. const
  3108. { For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit,
  3109.  * otherwise return zero.
  3110.  *
  3111.  * For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit.
  3112.  * Typically, return GMR_HELPHIT if you were hit.
  3113.  * It is possible to pass a UWORD to the application via the Code field
  3114.  * of the IDCMP_GADGETHELP message.  Return GMR_HELPCODE or'd with
  3115.  * the UWORD-sized result you wish to return.
  3116.  *
  3117.  * GMR_HELPHIT yields a Code value of ((UWORD) ~0), which should
  3118.  * mean "nothing particular" to the application.
  3119.  }
  3120.  
  3121.  GMR_GADGETHIT  = ($00000004);    { GM_HITTEST hit }
  3122.  
  3123.  GMR_NOHELPHIT  = ($00000000);    { GM_HELPTEST didn't hit }
  3124.  GMR_HELPHIT    = ($FFFFFFFF);    { GM_HELPTEST hit, return code = ~0 }
  3125.  GMR_HELPCODE   = ($00010000);    { GM_HELPTEST hit, return low word as code }
  3126.  
  3127.  
  3128. { GM_RENDER    }
  3129. Type
  3130.    pgpRender = ^tgpRender;
  3131.    tgpRender = record
  3132.     MethodID  : ULONG;
  3133.     gpr_GInfo : pGadgetInfo;      { gadget context               }
  3134.     gpr_RPort : pRastPort;        { all ready for use            }
  3135.     gpr_Redraw : Longint;           { might be a "highlight pass"  }
  3136.    END;
  3137.  
  3138. { values of gpr_Redraw }
  3139. CONST
  3140.  GREDRAW_UPDATE = (2);     { incremental update, e.g. prop slider }
  3141.  GREDRAW_REDRAW = (1);     { redraw gadget        }
  3142.  GREDRAW_TOGGLE = (0);     { toggle highlight, IF applicable      }
  3143.  
  3144. { GM_GOACTIVE, GM_HANDLEINPUT  }
  3145. Type
  3146.  
  3147.   pgpInput = ^tgpInput;
  3148.   tgpInput = record
  3149.     MethodID : ULONG;
  3150.     gpi_GInfo : pGadgetInfo;
  3151.     gpi_IEvent : pInputEvent;
  3152.     gpi_Termination : Pointer;
  3153.     gpi_Mouse : record
  3154.             x : Integer;
  3155.             y : Integer;
  3156.                 end;
  3157.     {* (V39) Pointer to TabletData structure, if this event originated
  3158.      * from a tablet which sends IESUBCLASS_NEWTABLET events, or NULL if
  3159.      * not.
  3160.      *
  3161.      * DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39!
  3162.      * IT WILL BE INVALID!
  3163.      *}
  3164.    gpi_TabletData  : pTabletData;
  3165.   END;
  3166.  
  3167. { GM_HANDLEINPUT and GM_GOACTIVE  return code flags    }
  3168. { return GMR_MEACTIVE (0) alone if you want more input.
  3169.  * Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  3170.  * GMR_VERIFY.
  3171.  }
  3172. CONST
  3173.  GMR_MEACTIVE  =  (0);
  3174.  GMR_NOREUSE   =  (2);
  3175.  GMR_REUSE     =  (4);
  3176.  GMR_VERIFY    =  (8);        { you MUST set cgp_Termination }
  3177.  
  3178. { New for V37:
  3179.  * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  3180.  * which instructs Intuition to activate the next or previous gadget
  3181.  * that has GFLG_TABCYCLE set.
  3182.  }
  3183.  GMR_NEXTACTIVE = (16);
  3184.  GMR_PREVACTIVE = (32);
  3185.  
  3186. { GM_GOINACTIVE }
  3187. Type
  3188.  
  3189.    pgpGoInactive = ^tgpGoInactive;
  3190.    tgpGoInactive = record
  3191.     MethodID    : ULONG;
  3192.     gpgi_GInfo  : pGadgetInfo;
  3193.  
  3194.     { V37 field only!  DO NOT attempt to read under V36! }
  3195.     gpgi_Abort  : ULONG;               { gpgi_Abort=1 IF gadget was aborted
  3196.                                          * by Intuition and 0 if gadget went
  3197.                                          * inactive at its own request
  3198.                                          }
  3199.    END;
  3200.  
  3201. {* New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when
  3202.  * the gadget is added to the window (or when the window opens, if
  3203.  * the gadget was part of the NewWindow.FirstGadget or the WA_Gadgets
  3204.  * list), or when the window is resized.  Your gadget can set the
  3205.  * GA_RelSpecial property to get GM_LAYOUT events without Intuition
  3206.  * changing the interpretation of your gadget select box.  This
  3207.  * allows for completely arbitrary resizing/repositioning based on
  3208.  * window size.
  3209.  *}
  3210. {* GM_LAYOUT *}
  3211. Type
  3212.  
  3213.  pgpLayout = ^tgpLayout;
  3214.  tgpLayout = record
  3215.     MethodID            : ULONG;
  3216.     gpl_GInfo           : pGadgetInfo;
  3217.     gpl_Initial         : ULONG;      {* non-zero if this method was invoked
  3218.                                          * during AddGList() or OpenWindow()
  3219.                                          * time.  zero if this method was invoked
  3220.                                          * during window resizing.
  3221.                                          *}
  3222.  end;
  3223.  
  3224.  
  3225. CONST
  3226.  ICM_Dummy      = ($0401);       { used for nothing             }
  3227.  ICM_SETLOOP    = ($0402);       { set/increment loop counter   }
  3228.  ICM_CLEARLOOP  = ($0403);       { clear/decrement loop counter }
  3229.  ICM_CHECKLOOP  = ($0404);       { set/increment loop           }
  3230.  
  3231. { no parameters for ICM_SETLOOP, ICM_CLEARLOOP, ICM_CHECKLOOP  }
  3232.  
  3233. { interconnection attributes used by icclass, modelclass, and gadgetclass }
  3234.  ICA_Dummy      = (TAG_USER+$40000);
  3235.  ICA_TARGET     = (ICA_Dummy + 1);
  3236.         { interconnection target               }
  3237.  ICA_MAP        = (ICA_Dummy + 2);
  3238.         { interconnection map tagitem list     }
  3239.  ICSPECIAL_CODE = (ICA_Dummy + 3);
  3240.         { a "pseudo-attribute", see below.     }
  3241.  
  3242. { Normally, the value for ICA_TARGET is some object pointer,
  3243.  * but if you specify the special value ICTARGET_IDCMP, notification
  3244.  * will be send as an IDCMP_IDCMPUPDATE message to the appropriate window's
  3245.  * IDCMP port.  See the definition of IDCMP_IDCMPUPDATE.
  3246.  *
  3247.  * When you specify ICTARGET_IDCMP for ICA_TARGET, the map you
  3248.  * specify will be applied to derive the attribute list that is
  3249.  * sent with the IDCMP_IDCMPUPDATE message.  If you specify a map list
  3250.  * which results in the attribute tag id ICSPECIAL_CODE, the
  3251.  * lower sixteen bits of the corresponding ti_Data value will
  3252.  * be copied into the Code field of the IDCMP_IDCMPUPDATE IntuiMessage.
  3253.  }
  3254.  ICTARGET_IDCMP = (NOT 0);
  3255.  
  3256.  
  3257. CONST
  3258.  CUSTOMIMAGEDEPTH     =   (-1);
  3259. { if image.Depth is this, it's a new Image class object }
  3260.  
  3261.  
  3262. {****************************************************}
  3263. CONST
  3264.  IA_Dummy             =   (TAG_USER + $20000);
  3265.  IA_Left              =   (IA_Dummy + $01);
  3266.  IA_Top               =   (IA_Dummy + $02);
  3267.  IA_Width             =   (IA_Dummy + $03);
  3268.  IA_Height            =   (IA_Dummy + $04);
  3269.  IA_FGPen             =   (IA_Dummy + $05);
  3270.                     { IA_FGPen also means "PlanePick"  }
  3271.  IA_BGPen             =   (IA_Dummy + $06);
  3272.                     { IA_BGPen also means "PlaneOnOff" }
  3273.  IA_Data              =   (IA_Dummy + $07);
  3274.                     { bitplanes, for classic image,
  3275.                      * other image classes may use it for other things
  3276.                      }
  3277.  IA_LineWidth         =   (IA_Dummy + $08);
  3278.  IA_Pens              =   (IA_Dummy + $0E);
  3279.                     { pointer to UWORD pens[],
  3280.                      * ala DrawInfo.Pens, MUST be
  3281.                      * terminated by ~0.  Some classes can
  3282.                      * choose to have this, or SYSIA_DrawInfo,
  3283.                      * or both.
  3284.                      }
  3285.  IA_Resolution        =   (IA_Dummy + $0F);
  3286.                     { packed uwords for x/y resolution into a longword
  3287.                      * ala DrawInfo.Resolution
  3288.                      }
  3289.  
  3290. {*** see class documentation to learn which    ****}
  3291. {*** classes recognize these                   ****}
  3292.  IA_APattern           =  (IA_Dummy + $10);
  3293.  IA_APatSize           =  (IA_Dummy + $11);
  3294.  IA_Mode               =  (IA_Dummy + $12);
  3295.  IA_Font               =  (IA_Dummy + $13);
  3296.  IA_Outline            =  (IA_Dummy + $14);
  3297.  IA_Recessed           =  (IA_Dummy + $15);
  3298.  IA_DoubleEmboss       =  (IA_Dummy + $16);
  3299.  IA_EdgesOnly          =  (IA_Dummy + $17);
  3300.  
  3301. {*** "sysiclass" attributes                    ****}
  3302.  SYSIA_Size            =  (IA_Dummy + $0B);
  3303.                     { 's below          }
  3304.  SYSIA_Depth           =  (IA_Dummy + $0C);
  3305.                     { this is unused by Intuition.  SYSIA_DrawInfo
  3306.                      * is used instead for V36
  3307.                      }
  3308.  SYSIA_Which           =  (IA_Dummy + $0D);
  3309.                     { see 's below      }
  3310.  SYSIA_DrawInfo        =  (IA_Dummy + $18);
  3311.                     { pass to sysiclass, please }
  3312.  
  3313. {****  obsolete: don't use these, use IA_Pens  ****}
  3314.  SYSIA_Pens            =  IA_Pens;
  3315.  IA_ShadowPen          =  (IA_Dummy + $09);
  3316.  IA_HighlightPen       =  (IA_Dummy + $0A);
  3317.  
  3318. { New for V39: }
  3319.  SYSIA_ReferenceFont   =  (IA_Dummy + $19);
  3320.                     { Font to use as reference for scaling
  3321.                      * certain sysiclass images
  3322.                      }
  3323.  IA_SupportsDisable    =  (IA_Dummy + $1a);
  3324.                     { By default, Intuition ghosts gadgets itself,
  3325.                      * instead of relying on IDS_DISABLED or
  3326.                      * IDS_SELECTEDDISABLED.  An imageclass that
  3327.                      * supports these states should return this attribute
  3328.                      * as TRUE.  You cannot set or clear this attribute,
  3329.                      * however.
  3330.                      }
  3331.  
  3332.  IA_FrameType          =  (IA_Dummy + $1b);
  3333.                     { Starting with V39, FrameIClass recognizes
  3334.                      * several standard types of frame.  Use one
  3335.                      * of the FRAME_ specifiers below.  Defaults
  3336.                      * to FRAME_DEFAULT.
  3337.                      }
  3338.  
  3339. {* next attribute: (IA_Dummy + $1c)   *}
  3340.  
  3341. {***********************************************}
  3342.  
  3343. { data values for SYSIA_Size   }
  3344.  SYSISIZE_MEDRES = (0);
  3345.  SYSISIZE_LOWRES = (1);
  3346.  SYSISIZE_HIRES  = (2);
  3347.  
  3348. {
  3349.  * SYSIA_Which tag data values:
  3350.  * Specifies which system gadget you want an image for.
  3351.  * Some numbers correspond to internal Intuition s
  3352.  }
  3353.  DEPTHIMAGE     = ($00);
  3354.  ZOOMIMAGE      = ($01);
  3355.  SIZEIMAGE      = ($02);
  3356.  CLOSEIMAGE     = ($03);
  3357.  SDEPTHIMAGE    = ($05); { screen depth gadget }
  3358.  LEFTIMAGE      = ($0A);
  3359.  UPIMAGE        = ($0B);
  3360.  RIGHTIMAGE     = ($0C);
  3361.  DOWNIMAGE      = ($0D);
  3362.  CHECKIMAGE     = ($0E);
  3363.  MXIMAGE        = ($0F); { mutual exclude "button" }
  3364. {* New for V39: *}
  3365.  MENUCHECK      = ($10); { Menu checkmark image }
  3366.  AMIGAKEY       = ($11); { Menu Amiga-key image }
  3367.  
  3368.  
  3369. { image message id's   }
  3370.     IM_DRAW     = $202;  { draw yourself, with "state"          }
  3371.     IM_HITTEST  = $203;  { return TRUE IF click hits image      }
  3372.     IM_ERASE    = $204;  { erase yourself                       }
  3373.     IM_MOVE     = $205;  { draw new AND erase old, smoothly     }
  3374.  
  3375.     IM_DRAWFRAME= $206;  { draw with specified dimensions       }
  3376.     IM_FRAMEBOX = $207;  { get recommended frame around some box}
  3377.     IM_HITFRAME = $208;  { hittest with dimensions              }
  3378.     IM_ERASEFRAME= $209; { hittest with dimensions              }
  3379.  
  3380. { image draw states or styles, for IM_DRAW }
  3381.     IDS_NORMAL          = (0);
  3382.     IDS_SELECTED        = (1);    { for selected gadgets     }
  3383.     IDS_DISABLED        = (2);    { for disabled gadgets     }
  3384.     IDS_BUSY            = (3);    { for future functionality }
  3385.     IDS_INDETERMINATE   = (4);    { for future functionality }
  3386.     IDS_INACTIVENORMAL  = (5);    { normal, in inactive window border }
  3387.     IDS_INACTIVESELECTED= (6);    { selected, in inactive border }
  3388.     IDS_INACTIVEDISABLED= (7);    { disabled, in inactive border }
  3389.  
  3390. { oops, please forgive spelling error by jimm }
  3391.  IDS_INDETERMINANT = IDS_INDETERMINATE;
  3392.  
  3393. { IM_FRAMEBOX  }
  3394. Type
  3395.  
  3396.   pimpFrameBox = ^timpFrameBox;
  3397.   timpFrameBox = record
  3398.     MethodID   : ULONG;
  3399.     imp_ContentsBox  : pIBox;       { input: relative box of contents }
  3400.     imp_FrameBox     : pIBox;          { output: rel. box of encl frame  }
  3401.     imp_DrInfo       : pDrawInfo;
  3402.     imp_FrameFlags   : ULONG;
  3403.   END;
  3404.  
  3405. CONST
  3406.  FRAMEF_SPECIFY = (1);  { Make do with the dimensions of FrameBox
  3407.                                  * provided.
  3408.                                  }
  3409.  
  3410. { IM_DRAW, IM_DRAWFRAME        }
  3411. Type
  3412.  
  3413.    pimpDraw = ^timpDraw;
  3414.    timpDraw = record
  3415.     MethodID    : ULONG;
  3416.     imp_RPort   : pRastPort;
  3417.     imp_Offset  : record
  3418.               x : Word;
  3419.               y : Word;
  3420.                   end;
  3421.     imp_State   : ULONG;
  3422.     imp_DrInfo  : pDrawInfo;
  3423.  
  3424.     { these parameters only valid for IM_DRAWFRAME }
  3425.     imp_Dimensions : record
  3426.              Width : Word;
  3427.             Height : Word;
  3428.                      end;
  3429.    END;
  3430.  
  3431. { IM_ERASE, IM_ERASEFRAME      }
  3432. { NOTE: This is a subset of impDraw    }
  3433.  
  3434.    pimpErase = ^timpErase;
  3435.    timpErase = record
  3436.     MethodID       : ULONG;
  3437.     imp_RPort      : pRastPort;
  3438.     imp_Offset     : record
  3439.                  x : Word;
  3440.                  y : Word;
  3441.                      end;
  3442.  
  3443.     { these parameters only valid for IM_ERASEFRAME }
  3444.     imp_Dimensions : record
  3445.              Width : Word;
  3446.             Height : Word;
  3447.                      end;
  3448.    END;
  3449.  
  3450. { IM_HITTEST, IM_HITFRAME      }
  3451.  
  3452.    pimpHitTest = ^timpHitTest;
  3453.    timpHitTest = record
  3454.     MethodID   : ULONG;
  3455.     imp_Point  : record
  3456.              x : Word;
  3457.              y : Word;
  3458.                  end;
  3459.  
  3460.     { these parameters only valid for IM_HITFRAME }
  3461.     imp_Dimensions : record
  3462.                Width : Word;
  3463.                Height : Word;
  3464.                end;
  3465.    END;
  3466.  
  3467.  { **  'boopsi' pointer class interface }
  3468.  
  3469. const
  3470. { The following tags are recognized at NewObject() time by
  3471.  * pointerclass:
  3472.  *
  3473.  * POINTERA_BitMap (struct BitMap *) - Pointer to bitmap to
  3474.  *      get pointer imagery from.  Bitplane data need not be
  3475.  *      in chip RAM.
  3476.  * POINTERA_XOffset (LONG) - X-offset of the pointer hotspot.
  3477.  * POINTERA_YOffset (LONG) - Y-offset of the pointer hotspot.
  3478.  * POINTERA_WordWidth (ULONG) - designed width of the pointer in words
  3479.  * POINTERA_XResolution (ULONG) - one of the POINTERXRESN_ flags below
  3480.  * POINTERA_YResolution (ULONG) - one of the POINTERYRESN_ flags below
  3481.  *
  3482.  }
  3483.  
  3484.  POINTERA_Dummy = (TAG_USER + $39000);
  3485.  
  3486.  POINTERA_BitMap        = (POINTERA_Dummy + $01);
  3487.  POINTERA_XOffset       = (POINTERA_Dummy + $02);
  3488.  POINTERA_YOffset       = (POINTERA_Dummy + $03);
  3489.  POINTERA_WordWidth     = (POINTERA_Dummy + $04);
  3490.  POINTERA_XResolution   = (POINTERA_Dummy + $05);
  3491.  POINTERA_YResolution   = (POINTERA_Dummy + $06);
  3492.  
  3493. { These are the choices for the POINTERA_XResolution attribute which
  3494.  * will determine what resolution pixels are used for this pointer.
  3495.  *
  3496.  * POINTERXRESN_DEFAULT (ECS-compatible pointer width)
  3497.  *      = 70 ns if SUPERHIRES-type mode, 140 ns if not
  3498.  *
  3499.  * POINTERXRESN_SCREENRES
  3500.  *      = Same as pixel speed of screen
  3501.  *
  3502.  * POINTERXRESN_LORES (pointer always in lores-like pixels)
  3503.  *      = 140 ns in 15kHz modes, 70 ns in 31kHz modes
  3504.  *
  3505.  * POINTERXRESN_HIRES (pointer always in hires-like pixels)
  3506.  *      = 70 ns in 15kHz modes, 35 ns in 31kHz modes
  3507.  *
  3508.  * POINTERXRESN_140NS (pointer always in 140 ns pixels)
  3509.  *      = 140 ns always
  3510.  *
  3511.  * POINTERXRESN_70NS (pointer always in 70 ns pixels)
  3512.  *      = 70 ns always
  3513.  *
  3514.  * POINTERXRESN_35NS (pointer always in 35 ns pixels)
  3515.  *      = 35 ns always
  3516.  }
  3517.  
  3518.  POINTERXRESN_DEFAULT   = 0;
  3519.  POINTERXRESN_140NS     = 1;
  3520.  POINTERXRESN_70NS      = 2;
  3521.  POINTERXRESN_35NS      = 3;
  3522.  
  3523.  POINTERXRESN_SCREENRES = 4;
  3524.  POINTERXRESN_LORES     = 5;
  3525.  POINTERXRESN_HIRES     = 6;
  3526.  
  3527. { These are the choices for the POINTERA_YResolution attribute which
  3528.  * will determine what vertical resolution is used for this pointer.
  3529.  *
  3530.  * POINTERYRESN_DEFAULT
  3531.  *      = In 15 kHz modes, the pointer resolution will be the same
  3532.  *        as a non-interlaced screen.  In 31 kHz modes, the pointer
  3533.  *        will be doubled vertically.  This means there will be about
  3534.  *        200-256 pointer lines per screen.
  3535.  *
  3536.  * POINTERYRESN_HIGH
  3537.  * POINTERYRESN_HIGHASPECT
  3538.  *      = Where the hardware/software supports it, the pointer resolution
  3539.  *        will be high.  This means there will be about 400-480 pointer
  3540.  *        lines per screen.  POINTERYRESN_HIGHASPECT also means that
  3541.  *        when the pointer comes out double-height due to hardware/software
  3542.  *        restrictions, its width would be doubled as well, if possible
  3543.  *        (to preserve aspect).
  3544.  *
  3545.  * POINTERYRESN_SCREENRES
  3546.  * POINTERYRESN_SCREENRESASPECT
  3547.  *      = Will attempt to match the vertical resolution of the pointer
  3548.  *        to the screen's vertical resolution.  POINTERYRESN_SCREENASPECT also
  3549.  *        means that when the pointer comes out double-height due to
  3550.  *        hardware/software restrictions, its width would be doubled as well,
  3551.  *        if possible (to preserve aspect).
  3552.  *
  3553.  }
  3554.  
  3555.  POINTERYRESN_DEFAULT          =  0;
  3556.  POINTERYRESN_HIGH             =  2;
  3557.  POINTERYRESN_HIGHASPECT       =  3;
  3558.  POINTERYRESN_SCREENRES        =  4;
  3559.  POINTERYRESN_SCREENRESASPECT  =  5;
  3560.  
  3561. { Compatibility note:
  3562.  *
  3563.  * The AA chipset supports variable sprite width and resolution, but
  3564.  * the setting of width and resolution is global for all sprites.
  3565.  * When no other sprites are in use, Intuition controls the sprite
  3566.  * width and sprite resolution for correctness based on pointerclass
  3567.  * attributes specified by the creator of the pointer.  Intuition
  3568.  * controls sprite resolution with the VTAG_DEFSPRITERESN_SET tag
  3569.  * to VideoControl().  Applications can override this on a per-viewport
  3570.  * basis with the VTAG_SPRITERESN_SET tag to VideoControl().
  3571.  *
  3572.  * If an application uses a sprite other than the pointer sprite,
  3573.  * Intuition will automatically regenerate the pointer sprite's image in
  3574.  * a compatible width.  This might involve BitMap scaling of the imagery
  3575.  * you supply.
  3576.  *
  3577.  * If any sprites other than the pointer sprite were obtained with the
  3578.  * old GetSprite() call, Intuition assumes that the owner of those
  3579.  * sprites is unaware of sprite resolution, hence Intuition will set the
  3580.  * default sprite resolution (VTAG_DEFSPRITERESN_SET) to ECS-compatible,
  3581.  * instead of as requested by the various pointerclass attributes.
  3582.  *
  3583.  * No resolution fallback occurs when applications use ExtSprites.
  3584.  * Such applications are expected to use VTAG_SPRITERESN_SET tag if
  3585.  * necessary.
  3586.  *
  3587.  * NB:  Under release V39, only sprite width compatibility is implemented.
  3588.  * Sprite resolution compatibility was added for V40.
  3589.  }
  3590.  
  3591.  
  3592. Type
  3593.  
  3594.    pStringExtend = ^tStringExtend;
  3595.    tStringExtend = record
  3596.     { display specifications   }
  3597.     Font        : pTextFont;      { must be an open Font (not TextAttr)  }
  3598.     Pens        : Array[0..1] of Byte;        { color of text/backgroun              }
  3599.     ActivePens  : Array[0..1] of Byte;  { colors when gadget is active         }
  3600.  
  3601.     { edit specifications      }
  3602.     InitialModes : ULONG;   { initial mode flags, below            }
  3603.     EditHook     : pHook;      { IF non-NULL, must supply WorkBuffer  }
  3604.     WorkBuffer   : STRPTR;    { must be as large as StringInfo.Buffer}
  3605.  
  3606.     Reserved     : Array[0..3] of ULONG;    { set to 0                             }
  3607.    END;
  3608.  
  3609.    pSGWork = ^tSGWork;
  3610.    tSGWork = record
  3611.     { set up when gadget is first activated    }
  3612.     Gad       : pGadget;         { the contestant itself        }   { Gadget in C-Includes }
  3613.     StrInfo   : pStringInfo;     { easy access to sinfo         }   { StrInfo in C-Includes }
  3614.     WorkBuffer : STRPTR;           { intuition's planned result   }
  3615.     PrevBuffer : STRPTR;           { what was there before        }
  3616.     Modes      : ULONG;          { current mode                 }
  3617.  
  3618.     { modified for each input event    }
  3619.     IEvent     : pInputEvent;    { actual event: do not change  }
  3620.     Code       : Word;            { character code, IF one byte  }
  3621.     BufferPos  : Integer;            { cursor position              }
  3622.     NumChars   : Integer;
  3623.     Actions    : ULONG;          { what Intuition will do       }
  3624.     LongInt_   : Longint;          { temp storage for longint     }
  3625.  
  3626.     GInfo      : pGadgetInfo;    { see cghooks.h                }   { GadgetInfo in C-Includes }
  3627.     EditOp     : Word;            { from constants below         }
  3628.    END;
  3629.  
  3630. { SGWork.EditOp -
  3631.  * These values indicate what basic type of operation the global
  3632.  * editing hook has performed on the string before your gadget's custom
  3633.  * editing hook gets called.  You do not have to be concerned with the
  3634.  * value your custom hook leaves in the EditOp field, only if you
  3635.  * write a global editing hook.
  3636.  *
  3637.  * For most of these general edit operations, you'll want to compare
  3638.  * the BufferPos and NumChars of the StringInfo (before global editing)
  3639.  * and SGWork (after global editing).
  3640.  }
  3641.  
  3642. CONST
  3643.  EO_NOOP       =  ($0001);
  3644.         { did nothing                                                  }
  3645.  EO_DELBACKWARD=  ($0002);
  3646.         { deleted some chars (maybe 0).                                }
  3647.  EO_DELFORWARD =  ($0003);
  3648.         { deleted some characters under and in front of the cursor     }
  3649.  EO_MOVECURSOR =  ($0004);
  3650.         { moved the cursor                                             }
  3651.  EO_ENTER      =  ($0005);
  3652.         { "enter" or "return" key, terminate                           }
  3653.  EO_RESET      =  ($0006);
  3654.         { current Intuition-style undo                                 }
  3655.  EO_REPLACECHAR=  ($0007);
  3656.         { replaced one character and (maybe) advanced cursor           }
  3657.  EO_INSERTCHAR =  ($0008);
  3658.         { inserted one char into string or added one at end            }
  3659.  EO_BADFORMAT  =  ($0009);
  3660.         { didn't like the text data, e.g., Bad LONGINT                 }
  3661.  EO_BIGCHANGE  =  ($000A);        { unused by Intuition  }
  3662.         { complete or major change to the text, e.g. new string        }
  3663.  EO_UNDO       =  ($000B);        { unused by Intuition  }
  3664.         { some other style of undo                                     }
  3665.  EO_CLEAR      =  ($000C);
  3666.         { clear the string                                             }
  3667.  EO_SPECIAL    =  ($000D);        { unused by Intuition  }
  3668.         { some operation that doesn't fit into the categories here     }
  3669.  
  3670.  
  3671. { Mode Flags definitions (ONLY first group allowed as InitialModes)    }
  3672.  SGM_REPLACE   =  (1);       { replace mode                 }
  3673. { please initialize StringInfo with in-range value of BufferPos
  3674.  * if you are using SGM_REPLACE mode.
  3675.  }
  3676.  
  3677.  SGM_FIXEDFIELD = (2);       { fixed length buffer          }
  3678.                                         { always set SGM_REPLACE, too  }
  3679.  SGM_NOFILTER   = (4);       { don't filter control chars   }
  3680.  
  3681. { SGM_EXITHELP is new for V37, and ignored by V36: }
  3682.  SGM_EXITHELP   = (128);       { exit with code = $5F IF HELP hit }
  3683.  
  3684.  
  3685. { These Mode Flags are for internal use only                           }
  3686.  SGM_NOCHANGE   = (8);       { no edit changes yet          }
  3687.  SGM_NOWORKB    = (16);       { Buffer == PrevBuffer         }
  3688.  SGM_CONTROL    = (32);       { control char escape mode     }
  3689.  SGM_LONGINT    = (64);       { an intuition longint gadget  }
  3690.  
  3691. { String Gadget Action Flags (put in SGWork.Actions by EditHook)       }
  3692.  SGA_USE        = ($1);  { use contents of SGWork               }
  3693.  SGA_END        = ($2);  { terminate gadget, code in Code field }
  3694.  SGA_BEEP       = ($4);  { flash the screen for the user        }
  3695.  SGA_REUSE      = ($8);  { reuse input event                    }
  3696.  SGA_REDISPLAY  = ($10); { gadget visuals changed               }
  3697.  
  3698. { New for V37: }
  3699.  SGA_NEXTACTIVE = ($20); { Make next possible gadget active.    }
  3700.  SGA_PREVACTIVE = ($40); { Make previous possible gadget active.}
  3701.  
  3702. { function id for only existing custom string gadget edit hook }
  3703.  
  3704.  SGH_KEY        = (1);    { process editing keystroke            }
  3705.  SGH_CLICK      = (2);    { process mouse click cursor position  }
  3706.  
  3707. { Here's a brief summary of how the custom string gadget edit hook works:
  3708.  *      You provide a hook in StringInfo.Extension.EditHook.
  3709.  *      The hook is called in the standard way with the 'object'
  3710.  *      a pointer to SGWork, and the 'message' a pointer to a command
  3711.  *      block, starting either with (longword) SGH_KEY, SGH_CLICK,
  3712.  *      or something new.
  3713.  *
  3714.  *      You return 0 if you don't understand the command (SGH_KEY is
  3715.  *      required and assumed).  Return non-zero if you implement the
  3716.  *      command.
  3717.  *
  3718.  *   SGH_KEY:
  3719.  *      There are no parameters following the command longword.
  3720.  *
  3721.  *      Intuition will put its idea of proper values in the SGWork
  3722.  *      before calling you, and if you leave SGA_USE set in the
  3723.  *      SGWork.Actions field, Intuition will use the values
  3724.  *      found in SGWork fields WorkBuffer, NumChars, BufferPos,
  3725.  *      and LongInt, copying the WorkBuffer back to the StringInfo
  3726.  *      Buffer.
  3727.  *
  3728.  *      NOTE WELL: You may NOT change other SGWork fields.
  3729.  *
  3730.  *      If you clear SGA_USE, the string gadget will be unchanged.
  3731.  *
  3732.  *      If you set SGA_END, Intuition will terminate the activation
  3733.  *      of the string gadget.  If you also set SGA_REUSE, Intuition
  3734.  *      will reuse the input event after it deactivates your gadget.
  3735.  *
  3736.  *      In this case, Intuition will put the value found in SGWork.Code
  3737.  *      into the IntuiMessage.Code field of the IDCMP_GADGETUP message it
  3738.  *      sends to the application.
  3739.  *
  3740.  *      If you set SGA_BEEP, Intuition will call DisplayBeep(); use
  3741.  *      this if the user has typed in error, or buffer is full.
  3742.  *
  3743.  *      Set SGA_REDISPLAY if the changes to the gadget warrant a
  3744.  *      gadget redisplay.  Note: cursor movement requires a redisplay.
  3745.  *
  3746.  *      Starting in V37, you may set SGA_PREVACTIVE or SGA_NEXTACTIVE
  3747.  *      when you set SGA_END.  This tells Intuition that you want
  3748.  *      the next or previous gadget with GFLG_TABCYCLE to be activated.
  3749.  *
  3750.  *   SGH_CLICK:
  3751.  *      This hook command is called when Intuition wants to position
  3752.  *      the cursor in response to a mouse click in the string gadget.
  3753.  *
  3754.  *      Again, here are no parameters following the command longword.
  3755.  *
  3756.  *      This time, Intuition has already calculated the mouse position
  3757.  *      character cell and put it in SGWork.BufferPos.  The previous
  3758.  *      BufferPos value remains in the SGWork.StringInfo.BufferPos.
  3759.  *
  3760.  *      Intuition will again use the SGWork fields listed above for
  3761.  *      SGH_KEY.  One restriction is that you are NOT allowed to set
  3762.  *      SGA_END or SGA_REUSE for this command.  Intuition will not
  3763.  *      stand for a gadget which goes inactive when you click in it.
  3764.  *
  3765.  *      You should always leave the SGA_REDISPLAY flag set, since Intuition
  3766.  *      uses this processing when activating a string gadget.
  3767.  }
  3768.  
  3769. FUNCTION ActivateGadget(gadgets : pGadget; window : pWindow; requester : pRequester) : BOOLEAN;
  3770. PROCEDURE ActivateWindow(window : pWindow);
  3771. PROCEDURE AddClass(classPtr : pIClass);
  3772. FUNCTION AddGadget(window : pWindow; gadget : pGadget; position : ULONG) : WORD;
  3773. FUNCTION AddGList(window : pWindow; gadget : pGadget; position : ULONG; numGad : LONGINT; requester : pRequester) : WORD;
  3774. FUNCTION AllocRemember(VAR rememberKey : pRemember; size : ULONG; flags : ULONG) : POINTER;
  3775. FUNCTION AllocScreenBuffer(sc : pScreen; bm : pBitMap; flags : ULONG) : pScreenBuffer;
  3776. FUNCTION AutoRequest(window : pWindow; body : pIntuiText; posText : pIntuiText; negText : pIntuiText; pFlag : ULONG; nFlag : ULONG; width : ULONG; height : ULONG) : BOOLEAN;
  3777. PROCEDURE BeginRefresh(window : pWindow);
  3778. FUNCTION BuildEasyRequestArgs(window : pWindow; easyStruct : pEasyStruct; idcmp : ULONG; args : POINTER) : pWindow;
  3779. FUNCTION BuildSysRequest(window : pWindow; body : pIntuiText; posText : pIntuiText; negText : pIntuiText; flags : ULONG; width : ULONG; height : ULONG) : pWindow;
  3780. FUNCTION ChangeScreenBuffer(sc : pScreen; sb : pScreenBuffer) : ULONG;
  3781. PROCEDURE ChangeWindowBox(window : pWindow; left : LONGINT; top : LONGINT; width : LONGINT; height : LONGINT);
  3782. FUNCTION ClearDMRequest(window : pWindow) : BOOLEAN;
  3783. PROCEDURE ClearMenuStrip(window : pWindow);
  3784. PROCEDURE ClearPointer(window : pWindow);
  3785. PROCEDURE CloseScreen(screen : pScreen);
  3786. PROCEDURE CloseWindow(window : pWindow);
  3787. FUNCTION CloseWorkBench : BOOLEAN;
  3788. PROCEDURE CurrentTime(VAR seconds : ULONG; VAR micros : ULONG);
  3789. FUNCTION DisplayAlert(alertNumber : ULONG; string_ : pCHAR; height : ULONG) : BOOLEAN;
  3790. PROCEDURE DisplayBeep(screen : pScreen);
  3791. PROCEDURE DisposeObject(obj : POINTER);
  3792. FUNCTION DoGadgetMethodA(gad : pGadget; win : pWindow; req : pRequester; message : tMsg) : ULONG;
  3793. FUNCTION DoubleClick(sSeconds : ULONG; sMicros : ULONG; cSeconds : ULONG; cMicros : ULONG) : BOOLEAN;
  3794. PROCEDURE DrawBorder(rp : pRastPort; border : pBorder; leftOffset : LONGINT; topOffset : LONGINT);
  3795. PROCEDURE DrawImage(rp : pRastPort; image : pImage; leftOffset : LONGINT; topOffset : LONGINT);
  3796. PROCEDURE DrawImageState(rp : pRastPort; image : pImage; leftOffset : LONGINT; topOffset : LONGINT; state : ULONG; drawInfo : pDrawInfo);
  3797. FUNCTION EasyRequestArgs(window : pWindow; easyStruct : pEasyStruct; idcmpPtr : ULONG; args : POINTER) : LONGINT;
  3798. PROCEDURE EndRefresh(window : pWindow; complete : LONGINT);
  3799. PROCEDURE EndRequest(requester : pRequester; window : pWindow);
  3800. PROCEDURE EraseImage(rp : pRastPort; image : pImage; leftOffset : LONGINT; topOffset : LONGINT);
  3801. FUNCTION FreeClass(classPtr : pIClass) : BOOLEAN;
  3802. PROCEDURE FreeRemember(VAR rememberKey : pRemember; reallyForget : LONGINT);
  3803. PROCEDURE FreeScreenBuffer(sc : pScreen; sb : pScreenBuffer);
  3804. PROCEDURE FreeScreenDrawInfo(screen : pScreen; drawInfo : pDrawInfo);
  3805. PROCEDURE FreeSysRequest(window : pWindow);
  3806. PROCEDURE GadgetMouse(gadget : pGadget; gInfo : pGadgetInfo; mousePoint : POINTER);
  3807. FUNCTION GetAttr(attrID : ULONG; obj : POINTER; storagePtr : POINTER) : ULONG;
  3808. PROCEDURE GetDefaultPubScreen(nameBuffer : pCHAR);
  3809. FUNCTION GetDefPrefs(preferences : pPreferences; size : LONGINT) : pPreferences;
  3810. FUNCTION GetPrefs(preferences : pPreferences; size : LONGINT) : pPreferences;
  3811. FUNCTION GetScreenData(buffer : POINTER; size : ULONG; type_ : ULONG; screen : pScreen) : BOOLEAN;
  3812. FUNCTION GetScreenDrawInfo(screen : pScreen) : pDrawInfo;
  3813. PROCEDURE HelpControl(win : pWindow; flags : ULONG);
  3814. PROCEDURE InitRequester(requester : pRequester);
  3815. FUNCTION IntuiTextLength(iText : pIntuiText) : LONGINT;
  3816. FUNCTION ItemAddress(menuStrip : pMenu; menuNumber : ULONG) : pMenuItem;
  3817. PROCEDURE LendMenus(fromwindow : pWindow; towindow : pWindow);
  3818. FUNCTION LockIBase(dontknow : ULONG) : ULONG;
  3819. FUNCTION LockPubScreen(name : pCHAR) : pScreen;
  3820. FUNCTION LockPubScreenList : pList;
  3821. FUNCTION MakeClass(classID : pCHAR; superClassID : pCHAR; superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
  3822. FUNCTION MakeScreen(screen : pScreen) : LONGINT;
  3823. FUNCTION ModifyIDCMP(window : pWindow; flags : ULONG) : BOOLEAN;
  3824. PROCEDURE ModifyProp(gadget : pGadget; window : pWindow; requester : pRequester; flags : ULONG; horizPot : ULONG; vertPot : ULONG; horizBody : ULONG; vertBody : ULONG);
  3825. PROCEDURE MoveScreen(screen : pScreen; dx : LONGINT; dy : LONGINT);
  3826. PROCEDURE MoveWindow(window : pWindow; dx : LONGINT; dy : LONGINT);
  3827. PROCEDURE MoveWindowInFrontOf(window : pWindow; behindWindow : pWindow);
  3828. PROCEDURE NewModifyProp(gadget : pGadget; window : pWindow; requester : pRequester; flags : ULONG; horizPot : ULONG; vertPot : ULONG; horizBody : ULONG; vertBody : ULONG; numGad : LONGINT);
  3829. FUNCTION NewObjectA(classPtr : pIClass; classID : pCHAR; tagList : pTagItem) : POINTER;
  3830. FUNCTION NextObject(objectPtrPtr : POINTER) : POINTER;
  3831. FUNCTION NextPubScreen(screen : pScreen; namebuf : pCHAR) : pCHAR;
  3832. FUNCTION ObtainGIRPort(gInfo : pGadgetInfo) : pRastPort;
  3833. PROCEDURE OffGadget(gadget : pGadget; window : pWindow; requester : pRequester);
  3834. PROCEDURE OffMenu(window : pWindow; menuNumber : ULONG);
  3835. PROCEDURE OnGadget(gadget : pGadget; window : pWindow; requester : pRequester);
  3836. PROCEDURE OnMenu(window : pWindow; menuNumber : ULONG);
  3837. FUNCTION OpenScreen(newScreen : pNewScreen) : pScreen;
  3838. FUNCTION OpenScreenTagList(newScreen : pNewScreen; tagList : pTagItem) : pScreen;
  3839. FUNCTION OpenWindow(newWindow : pNewWindow) : pWindow;
  3840. FUNCTION OpenWindowTagList(newWindow : pNewWindow; tagList : pTagItem) : pWindow;
  3841. FUNCTION OpenWorkBench : ULONG;
  3842. FUNCTION PointInImage(point : ULONG; image : pImage) : BOOLEAN;
  3843. PROCEDURE PrintIText(rp : pRastPort; iText : pIntuiText; left : LONGINT; top : LONGINT);
  3844. FUNCTION PubScreenStatus(screen : pScreen; statusFlags : ULONG) : WORD;
  3845. FUNCTION QueryOverscan(displayID : ULONG; rect : pRectangle; oScanType : LONGINT) : LONGINT;
  3846. PROCEDURE RefreshGadgets(gadgets : pGadget; window : pWindow; requester : pRequester);
  3847. PROCEDURE RefreshGList(gadgets : pGadget; window : pWindow; requester : pRequester; numGad : LONGINT);
  3848. PROCEDURE RefreshWindowFrame(window : pWindow);
  3849. PROCEDURE ReleaseGIRPort(rp : pRastPort);
  3850. FUNCTION RemakeDisplay : LONGINT;
  3851. PROCEDURE RemoveClass(classPtr : pIClass);
  3852. FUNCTION RemoveGadget(window : pWindow; gadget : pGadget) : WORD;
  3853. FUNCTION RemoveGList(remPtr : pWindow; gadget : pGadget; numGad : LONGINT) : WORD;
  3854. PROCEDURE ReportMouse(flag : LONGINT; window : pWindow);
  3855. FUNCTION Request(requester : pRequester; window : pWindow) : BOOLEAN;
  3856. FUNCTION ResetMenuStrip(window : pWindow; menu : pMenu) : BOOLEAN;
  3857. FUNCTION RethinkDisplay : LONGINT;
  3858. PROCEDURE ScreenDepth(screen : pScreen; flags : ULONG; reserved : POINTER);
  3859. PROCEDURE ScreenPosition(screen : pScreen; flags : ULONG; x1 : LONGINT; y1 : LONGINT; x2 : LONGINT; y2 : LONGINT);
  3860. PROCEDURE ScreenToBack(screen : pScreen);
  3861. PROCEDURE ScreenToFront(screen : pScreen);
  3862. PROCEDURE ScrollWindowRaster(win : pWindow; dx : LONGINT; dy : LONGINT; xMin : LONGINT; yMin : LONGINT; xMax : LONGINT; yMax : LONGINT);
  3863. FUNCTION SetAttrsA(obj : POINTER; tagList : pTagItem) : ULONG;
  3864. PROCEDURE SetDefaultPubScreen(name : pCHAR);
  3865. FUNCTION SetDMRequest(window : pWindow; requester : pRequester) : BOOLEAN;
  3866. FUNCTION SetEditHook(hook : pHook) : pHook;
  3867. FUNCTION SetGadgetAttrsA(gadget : pGadget; window : pWindow; requester : pRequester; tagList : pTagItem) : ULONG;
  3868. FUNCTION SetMenuStrip(window : pWindow; menu : pMenu) : BOOLEAN;
  3869. FUNCTION SetMouseQueue(window : pWindow; queueLength : ULONG) : LONGINT;
  3870. PROCEDURE SetPointer(window : pWindow; pointer_ : POINTER; height : LONGINT; width : LONGINT; xOffset : LONGINT; yOffset : LONGINT);
  3871. FUNCTION SetPrefs(preferences : pPreferences; size : LONGINT; inform : LONGINT) : pPreferences;
  3872. FUNCTION SetPubScreenModes(modes : ULONG) : WORD;
  3873. PROCEDURE SetWindowPointerA(win : pWindow; taglist : pTagItem);
  3874. PROCEDURE SetWindowTitles(window : pWindow; windowTitle : pCHAR; screenTitle : pCHAR);
  3875. PROCEDURE ShowTitle(screen : pScreen; showIt : LONGINT);
  3876. PROCEDURE SizeWindow(window : pWindow; dx : LONGINT; dy : LONGINT);
  3877. FUNCTION SysReqHandler(window : pWindow; idcmpPtr : ULONG; waitInput : LONGINT) : LONGINT;
  3878. FUNCTION TimedDisplayAlert(alertNumber : ULONG; string_ : pCHAR; height : ULONG; time : ULONG) : BOOLEAN;
  3879. PROCEDURE UnlockIBase(ibLock : ULONG);
  3880. PROCEDURE UnlockPubScreen(name : pCHAR; screen : pScreen);
  3881. PROCEDURE UnlockPubScreenList;
  3882. FUNCTION ViewAddress : pView;
  3883. FUNCTION ViewPortAddress(window : pWindow) : pViewPort;
  3884. FUNCTION WBenchToBack : BOOLEAN;
  3885. FUNCTION WBenchToFront : BOOLEAN;
  3886. FUNCTION WindowLimits(window : pWindow; widthMin : LONGINT; heightMin : LONGINT; widthMax : ULONG; heightMax : ULONG) : BOOLEAN;
  3887. PROCEDURE WindowToBack(window : pWindow);
  3888. PROCEDURE WindowToFront(window : pWindow);
  3889. PROCEDURE ZipWindow(window : pWindow);
  3890.  
  3891. { Intuition macros }
  3892. function INST_DATA (cl: pIClass; o: p_Object): Pointer;
  3893. function SIZEOF_INSTANCE (cl: pIClass): Longint;
  3894. function BASEOBJECT (o: p_Object): Pointer;
  3895. function _OBJ(o: p_Object): p_Object;
  3896. function __OBJECT (o: Pointer): p_Object;
  3897. function OCLASS (o: Pointer): pIClass;
  3898. function SHIFTITEM (n: integer): word;
  3899. function SHIFTMENU (n: integer): word;
  3900. function SHIFTSUB (n: integer): word;
  3901. function FULLMENUNUM (menu, item, sub: integer): word;
  3902. function IM_BGPEN (im: pImage): byte;
  3903. function IM_BOX (im: pImage): pIBox;
  3904. function IM_FGPEN (im: pImage): byte;
  3905. function GADGET_BOX (g: pGadget): pIBox;
  3906. function CUSTOM_HOOK (gadget: pGadget): pHook;
  3907. function ITEMNUM( n : Word): Word;
  3908. function MENUNUM( n : Word): Word;
  3909. function SUBNUM( n : Word): Word;
  3910.  
  3911. {$ifdef amiga_overlays}
  3912.  
  3913. FUNCTION DisplayAlert(alertNumber : ULONG; string_ : string; height : ULONG) : BOOLEAN;
  3914. FUNCTION LockPubScreen(name : string) : pScreen;
  3915. FUNCTION MakeClass(classID : string; superClassID : pCHAR; superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
  3916. FUNCTION MakeClass(classID : pCHAR; superClassID : string; superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
  3917. FUNCTION MakeClass(classID : string; superClassID : string; superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
  3918. FUNCTION NewObjectA(classPtr : pIClass; classID : string; tagList : pTagItem) : POINTER;
  3919. PROCEDURE SetDefaultPubScreen(name : string);
  3920. PROCEDURE SetWindowTitles(window : pWindow; windowTitle : string; screenTitle : pCHAR);
  3921. PROCEDURE SetWindowTitles(window : pWindow; windowTitle : pCHAR; screenTitle : string);
  3922. PROCEDURE SetWindowTitles(window : pWindow; windowTitle : string; screenTitle : string);
  3923. FUNCTION TimedDisplayAlert(alertNumber : ULONG; string_ : string; height : ULONG; time : ULONG) : BOOLEAN;
  3924. PROCEDURE UnlockPubScreen(name : string; screen : pScreen);
  3925.  
  3926. {$endif}
  3927.  
  3928. IMPLEMENTATION
  3929.  
  3930. {$ifdef amiga_overlays}
  3931. uses pastoc;
  3932. {$endif}
  3933.  
  3934. function INST_DATA (cl: pIClass; o: p_Object): Pointer;
  3935. begin
  3936.     INST_DATA := Pointer(Longint(o) + cl^.cl_InstOffset);
  3937. end;
  3938.  
  3939. function SIZEOF_INSTANCE (cl: pIClass): Longint;
  3940. begin
  3941.     SIZEOF_INSTANCE := cl^.cl_InstOffset + cl^.cl_InstSize + sizeof(t_Object);
  3942. end;
  3943.  
  3944. function BASEOBJECT (o: p_Object): Pointer;
  3945. begin
  3946.     BASEOBJECT := Pointer(Longint(o) + sizeof(t_Object));
  3947. end;
  3948.  
  3949. function _OBJ(o: p_Object): p_Object;
  3950. begin
  3951.      _OBJ := p_Object(o);
  3952. END;
  3953.  
  3954. function __OBJECT (o: Pointer): p_Object;
  3955. begin
  3956.     __OBJECT := p_Object(Longint(o) - sizeof(t_Object))
  3957. end;
  3958.  
  3959. function OCLASS (o: Pointer): pIClass;
  3960. var
  3961.     obj: p_Object;
  3962. begin
  3963.     obj := p_Object(Longint(o) - sizeof(t_Object));
  3964.     OCLASS := obj^.o_Class;
  3965. end;
  3966.  
  3967. function SHIFTITEM (n: integer): word;
  3968. begin
  3969.     SHIFTITEM := (n and $3f) shl 5
  3970. end;
  3971.  
  3972. function SHIFTMENU (n: integer): word;
  3973. begin
  3974.     SHIFTMENU := n and $1f
  3975. end;
  3976.  
  3977. function SHIFTSUB (n: integer): word;
  3978. begin
  3979.     SHIFTSUB := (n and $1f) shl 11
  3980. end;
  3981.  
  3982. function FULLMENUNUM (menu, item, sub: integer): word;
  3983. begin
  3984.     FULLMENUNUM := ((sub and $1f) shl 11) or
  3985.                     ((item and $3f) shl 5) or
  3986.                       (menu and $1f)
  3987. end;
  3988.  
  3989.  
  3990.  
  3991. { The next functons _BGPEN AND _FGPEN aren't a full replacement of the
  3992.   C macros because the C preprocessor makes it possible to set the
  3993.   A/BPen values of the image class objects as well. This can't work
  3994.   in pascal, of course! }
  3995.  
  3996. function IM_BGPEN (im: pImage): byte;
  3997. begin
  3998.     IM_BGPEN := im^.PlaneOnOff;
  3999. end;
  4000.  
  4001. function IM_BOX (im: pImage): pIBox;
  4002. begin
  4003.     IM_BOX := pIBox(@im^.LeftEdge);
  4004. END;
  4005.  
  4006. function IM_FGPEN (im: pImage): byte;
  4007. begin
  4008.     IM_FGPEN := im^.PlanePick;
  4009. end;
  4010.  
  4011. function GADGET_BOX (g: pGadget): pIBox;
  4012. begin
  4013.     GADGET_BOX := pIBox(@g^.LeftEdge);
  4014. end;
  4015.  
  4016. function CUSTOM_HOOK (gadget: pGadget): pHook;
  4017. begin
  4018.     CUSTOM_HOOK := pHook(gadget^.MutualExclude);
  4019. end;
  4020.  
  4021. function ITEMNUM( n : Word): Word;
  4022. begin
  4023.     ITEMNUM := (n shr 5) and $3F
  4024. end;
  4025.  
  4026. function MENUNUM( n : Word): Word;
  4027. begin
  4028.     MENUNUM := n and $1f
  4029. end;
  4030.  
  4031. function SUBNUM( n : Word): Word;
  4032. begin
  4033.     SUBNUM := (n shr 11) and $1f
  4034. end;
  4035.  
  4036. FUNCTION ActivateGadget(gadgets : pGadget; window : pWindow; requester : pRequester) : BOOLEAN;
  4037. BEGIN
  4038.   ASM
  4039.     MOVE.L  A6,-(A7)
  4040.     MOVEA.L gadgets,A0
  4041.     MOVEA.L window,A1
  4042.     MOVEA.L requester,A2
  4043.     MOVEA.L _IntuitionBase,A6
  4044.     JSR -462(A6)
  4045.     MOVEA.L (A7)+,A6
  4046.     TST.W   D0
  4047.     BEQ.B   @end
  4048.     MOVEQ   #1,D0
  4049.   @end: MOVE.B  D0,@RESULT
  4050.   END;
  4051. END;
  4052.  
  4053. PROCEDURE ActivateWindow(window : pWindow);
  4054. BEGIN
  4055.   ASM
  4056.     MOVE.L  A6,-(A7)
  4057.     MOVEA.L window,A0
  4058.     MOVEA.L _IntuitionBase,A6
  4059.     JSR -450(A6)
  4060.     MOVEA.L (A7)+,A6
  4061.   END;
  4062. END;
  4063.  
  4064. PROCEDURE AddClass(classPtr : pIClass);
  4065. BEGIN
  4066.   ASM
  4067.     MOVE.L  A6,-(A7)
  4068.     MOVEA.L classPtr,A0
  4069.     MOVEA.L _IntuitionBase,A6
  4070.     JSR -684(A6)
  4071.     MOVEA.L (A7)+,A6
  4072.   END;
  4073. END;
  4074.  
  4075. FUNCTION AddGadget(window : pWindow; gadget : pGadget; position : ULONG) : WORD;
  4076. BEGIN
  4077.   ASM
  4078.     MOVE.L  A6,-(A7)
  4079.     MOVEA.L window,A0
  4080.     MOVEA.L gadget,A1
  4081.     MOVE.L  position,D0
  4082.     MOVEA.L _IntuitionBase,A6
  4083.     JSR -042(A6)
  4084.     MOVEA.L (A7)+,A6
  4085.     MOVE.L  D0,@RESULT
  4086.   END;
  4087. END;
  4088.  
  4089. FUNCTION AddGList(window : pWindow; gadget : pGadget; position : ULONG; numGad : LONGINT; requester : pRequester) : WORD;
  4090. BEGIN
  4091.   ASM
  4092.     MOVE.L  A6,-(A7)
  4093.     MOVEA.L window,A0
  4094.     MOVEA.L gadget,A1
  4095.     MOVE.L  position,D0
  4096.     MOVE.L  numGad,D1
  4097.     MOVEA.L requester,A2
  4098.     MOVEA.L _IntuitionBase,A6
  4099.     JSR -438(A6)
  4100.     MOVEA.L (A7)+,A6
  4101.     MOVE.L  D0,@RESULT
  4102.   END;
  4103. END;
  4104.  
  4105. FUNCTION AllocRemember(VAR rememberKey : pRemember; size : ULONG; flags : ULONG) : POINTER;
  4106. BEGIN
  4107.   ASM
  4108.     MOVE.L  A6,-(A7)
  4109.     MOVEA.L rememberKey,A0
  4110.     MOVE.L  size,D0
  4111.     MOVE.L  flags,D1
  4112.     MOVEA.L _IntuitionBase,A6
  4113.     JSR -396(A6)
  4114.     MOVEA.L (A7)+,A6
  4115.     MOVE.L  D0,@RESULT
  4116.   END;
  4117. END;
  4118.  
  4119. FUNCTION AllocScreenBuffer(sc : pScreen; bm : pBitMap; flags : ULONG) : pScreenBuffer;
  4120. BEGIN
  4121.   ASM
  4122.     MOVE.L  A6,-(A7)
  4123.     MOVEA.L sc,A0
  4124.     MOVEA.L bm,A1
  4125.     MOVE.L  flags,D0
  4126.     MOVEA.L _IntuitionBase,A6
  4127.     JSR -768(A6)
  4128.     MOVEA.L (A7)+,A6
  4129.     MOVE.L  D0,@RESULT
  4130.   END;
  4131. END;
  4132.  
  4133. FUNCTION AutoRequest(window : pWindow; body : pIntuiText; posText : pIntuiText; negText : pIntuiText; pFlag : ULONG; nFlag : ULONG; width : ULONG; height : ULONG) : BOOLEAN;
  4134. BEGIN
  4135.   ASM
  4136.     MOVE.L  A6,-(A7)
  4137.     MOVEA.L window,A0
  4138.     MOVEA.L body,A1
  4139.     MOVEA.L posText,A2
  4140.     MOVEA.L negText,A3
  4141.     MOVE.L  pFlag,D0
  4142.     MOVE.L  nFlag,D1
  4143.     MOVE.L  width,D2
  4144.     MOVE.L  height,D3
  4145.     MOVEA.L _IntuitionBase,A6
  4146.     JSR -348(A6)
  4147.     MOVEA.L (A7)+,A6
  4148.     TST.W   D0
  4149.     BEQ.B   @end
  4150.     MOVEQ   #1,D0
  4151.   @end: MOVE.B  D0,@RESULT
  4152.   END;
  4153. END;
  4154.  
  4155. PROCEDURE BeginRefresh(window : pWindow);
  4156. BEGIN
  4157.   ASM
  4158.     MOVE.L  A6,-(A7)
  4159.     MOVEA.L window,A0
  4160.     MOVEA.L _IntuitionBase,A6
  4161.     JSR -354(A6)
  4162.     MOVEA.L (A7)+,A6
  4163.   END;
  4164. END;
  4165.  
  4166. FUNCTION BuildEasyRequestArgs(window : pWindow; easyStruct : pEasyStruct; idcmp : ULONG; args : POINTER) : pWindow;
  4167. BEGIN
  4168.   ASM
  4169.     MOVE.L  A6,-(A7)
  4170.     MOVEA.L window,A0
  4171.     MOVEA.L easyStruct,A1
  4172.     MOVE.L  idcmp,D0
  4173.     MOVEA.L args,A3
  4174.     MOVEA.L _IntuitionBase,A6
  4175.     JSR -594(A6)
  4176.     MOVEA.L (A7)+,A6
  4177.     MOVE.L  D0,@RESULT
  4178.   END;
  4179. END;
  4180.  
  4181. FUNCTION BuildSysRequest(window : pWindow; body : pIntuiText; posText : pIntuiText; negText : pIntuiText; flags : ULONG; width : ULONG; height : ULONG) : pWindow;
  4182. BEGIN
  4183.   ASM
  4184.     MOVE.L  A6,-(A7)
  4185.     MOVEA.L window,A0
  4186.     MOVEA.L body,A1
  4187.     MOVEA.L posText,A2
  4188.     MOVEA.L negText,A3
  4189.     MOVE.L  flags,D0
  4190.     MOVE.L  width,D1
  4191.     MOVE.L  height,D2
  4192.     MOVEA.L _IntuitionBase,A6
  4193.     JSR -360(A6)
  4194.     MOVEA.L (A7)+,A6
  4195.     MOVE.L  D0,@RESULT
  4196.   END;
  4197. END;
  4198.  
  4199. FUNCTION ChangeScreenBuffer(sc : pScreen; sb : pScreenBuffer) : ULONG;
  4200. BEGIN
  4201.   ASM
  4202.     MOVE.L  A6,-(A7)
  4203.     MOVEA.L sc,A0
  4204.     MOVEA.L sb,A1
  4205.     MOVEA.L _IntuitionBase,A6
  4206.     JSR -780(A6)
  4207.     MOVEA.L (A7)+,A6
  4208.     MOVE.L  D0,@RESULT
  4209.   END;
  4210. END;
  4211.  
  4212. PROCEDURE ChangeWindowBox(window : pWindow; left : LONGINT; top : LONGINT; width : LONGINT; height : LONGINT);
  4213. BEGIN
  4214.   ASM
  4215.     MOVE.L  A6,-(A7)
  4216.     MOVEA.L window,A0
  4217.     MOVE.L  left,D0
  4218.     MOVE.L  top,D1
  4219.     MOVE.L  width,D2
  4220.     MOVE.L  height,D3
  4221.     MOVEA.L _IntuitionBase,A6
  4222.     JSR -486(A6)
  4223.     MOVEA.L (A7)+,A6
  4224.   END;
  4225. END;
  4226.  
  4227. FUNCTION ClearDMRequest(window : pWindow) : BOOLEAN;
  4228. BEGIN
  4229.   ASM
  4230.     MOVE.L  A6,-(A7)
  4231.     MOVEA.L window,A0
  4232.     MOVEA.L _IntuitionBase,A6
  4233.     JSR -048(A6)
  4234.     MOVEA.L (A7)+,A6
  4235.     TST.W   D0
  4236.     BEQ.B   @end
  4237.     MOVEQ   #1,D0
  4238.   @end: MOVE.B  D0,@RESULT
  4239.   END;
  4240. END;
  4241.  
  4242. PROCEDURE ClearMenuStrip(window : pWindow);
  4243. BEGIN
  4244.   ASM
  4245.     MOVE.L  A6,-(A7)
  4246.     MOVEA.L window,A0
  4247.     MOVEA.L _IntuitionBase,A6
  4248.     JSR -054(A6)
  4249.     MOVEA.L (A7)+,A6
  4250.   END;
  4251. END;
  4252.  
  4253. PROCEDURE ClearPointer(window : pWindow);
  4254. BEGIN
  4255.   ASM
  4256.     MOVE.L  A6,-(A7)
  4257.     MOVEA.L window,A0
  4258.     MOVEA.L _IntuitionBase,A6
  4259.     JSR -060(A6)
  4260.     MOVEA.L (A7)+,A6
  4261.   END;
  4262. END;
  4263.  
  4264. PROCEDURE CloseScreen(screen : pScreen);
  4265. BEGIN
  4266.   ASM
  4267.     MOVE.L  A6,-(A7)
  4268.     MOVEA.L screen,A0
  4269.     MOVEA.L _IntuitionBase,A6
  4270.     JSR -066(A6)
  4271.     MOVEA.L (A7)+,A6
  4272.   END;
  4273. END;
  4274.  
  4275. PROCEDURE CloseWindow(window : pWindow);
  4276. BEGIN
  4277.   ASM
  4278.     MOVE.L  A6,-(A7)
  4279.     MOVEA.L window,A0
  4280.     MOVEA.L _IntuitionBase,A6
  4281.     JSR -072(A6)
  4282.     MOVEA.L (A7)+,A6
  4283.   END;
  4284. END;
  4285.  
  4286. FUNCTION CloseWorkBench : BOOLEAN;
  4287. BEGIN
  4288.   ASM
  4289.     MOVE.L  A6,-(A7)
  4290.     MOVEA.L _IntuitionBase,A6
  4291.     JSR -078(A6)
  4292.     MOVEA.L (A7)+,A6
  4293.     TST.L   D0
  4294.     BEQ.B   @end
  4295.     MOVEQ   #1,D0
  4296.     @end: MOVE.B  D0,@RESULT
  4297.   END;
  4298. END;
  4299.  
  4300. PROCEDURE CurrentTime(VAR seconds : ULONG; VAR micros : ULONG);
  4301. BEGIN
  4302.   ASM
  4303.     MOVE.L  A6,-(A7)
  4304.     MOVEA.L seconds,A0
  4305.     MOVEA.L micros,A1
  4306.     MOVEA.L _IntuitionBase,A6
  4307.     JSR -084(A6)
  4308.     MOVEA.L (A7)+,A6
  4309.   END;
  4310. END;
  4311.  
  4312. FUNCTION DisplayAlert(alertNumber : ULONG; string_ : pCHAR; height : ULONG) : BOOLEAN;
  4313. BEGIN
  4314.   ASM
  4315.     MOVE.L  A6,-(A7)
  4316.     MOVE.L  alertNumber,D0
  4317.     MOVEA.L string_,A0
  4318.     MOVE.L  height,D1
  4319.     MOVEA.L _IntuitionBase,A6
  4320.     JSR -090(A6)
  4321.     MOVEA.L (A7)+,A6
  4322.     TST.W   D0
  4323.     BEQ.B   @end
  4324.     MOVEQ   #1,D0
  4325.   @end: MOVE.B  D0,@RESULT
  4326.   END;
  4327. END;
  4328.  
  4329. PROCEDURE DisplayBeep(screen : pScreen);
  4330. BEGIN
  4331.   ASM
  4332.     MOVE.L  A6,-(A7)
  4333.     MOVEA.L screen,A0
  4334.     MOVEA.L _IntuitionBase,A6
  4335.     JSR -096(A6)
  4336.     MOVEA.L (A7)+,A6
  4337.   END;
  4338. END;
  4339.  
  4340. PROCEDURE DisposeObject(obj : POINTER);
  4341. BEGIN
  4342.   ASM
  4343.     MOVE.L  A6,-(A7)
  4344.     MOVEA.L obj,A0
  4345.     MOVEA.L _IntuitionBase,A6
  4346.     JSR -642(A6)
  4347.     MOVEA.L (A7)+,A6
  4348.   END;
  4349. END;
  4350.  
  4351. FUNCTION DoGadgetMethodA(gad : pGadget; win : pWindow; req : pRequester; message : tMsg) : ULONG;
  4352. BEGIN
  4353.   ASM
  4354.     MOVE.L  A6,-(A7)
  4355.     MOVEA.L gad,A0
  4356.     MOVEA.L win,A1
  4357.     MOVEA.L req,A2
  4358.     MOVEA.L message,A3
  4359.     MOVEA.L _IntuitionBase,A6
  4360.     JSR -810(A6)
  4361.     MOVEA.L (A7)+,A6
  4362.     MOVE.L  D0,@RESULT
  4363.   END;
  4364. END;
  4365.  
  4366. FUNCTION DoubleClick(sSeconds : ULONG; sMicros : ULONG; cSeconds : ULONG; cMicros : ULONG) : BOOLEAN;
  4367. BEGIN
  4368.   ASM
  4369.     MOVE.L  A6,-(A7)
  4370.     MOVE.L  sSeconds,D0
  4371.     MOVE.L  sMicros,D1
  4372.     MOVE.L  cSeconds,D2
  4373.     MOVE.L  cMicros,D3
  4374.     MOVEA.L _IntuitionBase,A6
  4375.     JSR -102(A6)
  4376.     MOVEA.L (A7)+,A6
  4377.     TST.W   D0
  4378.     BEQ.B   @end
  4379.     MOVEQ   #1,D0
  4380.   @end: MOVE.B  D0,@RESULT
  4381.   END;
  4382. END;
  4383.  
  4384. PROCEDURE DrawBorder(rp : pRastPort; border : pBorder; leftOffset : LONGINT; topOffset : LONGINT);
  4385. BEGIN
  4386.   ASM
  4387.     MOVE.L  A6,-(A7)
  4388.     MOVEA.L rp,A0
  4389.     MOVEA.L border,A1
  4390.     MOVE.L  leftOffset,D0
  4391.     MOVE.L  topOffset,D1
  4392.     MOVEA.L _IntuitionBase,A6
  4393.     JSR -108(A6)
  4394.     MOVEA.L (A7)+,A6
  4395.   END;
  4396. END;
  4397.  
  4398. PROCEDURE DrawImage(rp : pRastPort; image : pImage; leftOffset : LONGINT; topOffset : LONGINT);
  4399. BEGIN
  4400.   ASM
  4401.     MOVE.L  A6,-(A7)
  4402.     MOVEA.L rp,A0
  4403.     MOVEA.L image,A1
  4404.     MOVE.L  leftOffset,D0
  4405.     MOVE.L  topOffset,D1
  4406.     MOVEA.L _IntuitionBase,A6
  4407.     JSR -114(A6)
  4408.     MOVEA.L (A7)+,A6
  4409.   END;
  4410. END;
  4411.  
  4412. PROCEDURE DrawImageState(rp : pRastPort; image : pImage; leftOffset : LONGINT; topOffset : LONGINT; state : ULONG; drawInfo : pDrawInfo);
  4413. BEGIN
  4414.   ASM
  4415.     MOVE.L  A6,-(A7)
  4416.     MOVEA.L rp,A0
  4417.     MOVEA.L image,A1
  4418.     MOVE.L  leftOffset,D0
  4419.     MOVE.L  topOffset,D1
  4420.     MOVE.L  state,D2
  4421.     MOVEA.L drawInfo,A2
  4422.     MOVEA.L _IntuitionBase,A6
  4423.     JSR -618(A6)
  4424.     MOVEA.L (A7)+,A6
  4425.   END;
  4426. END;
  4427.  
  4428. FUNCTION EasyRequestArgs(window : pWindow; easyStruct : pEasyStruct; idcmpPtr : ULONG; args : POINTER) : LONGINT;
  4429. BEGIN
  4430.   ASM
  4431.     MOVE.L  A6,-(A7)
  4432.     MOVEA.L window,A0
  4433.     MOVEA.L easyStruct,A1
  4434.     MOVEA.L idcmpPtr,A2
  4435.     MOVEA.L args,A3
  4436.     MOVEA.L _IntuitionBase,A6
  4437.     JSR -588(A6)
  4438.     MOVEA.L (A7)+,A6
  4439.     MOVE.L  D0,@RESULT
  4440.   END;
  4441. END;
  4442.  
  4443. PROCEDURE EndRefresh(window : pWindow; complete : LONGINT);
  4444. BEGIN
  4445.   ASM
  4446.     MOVE.L  A6,-(A7)
  4447.     MOVEA.L window,A0
  4448.     MOVE.L  complete,D0
  4449.     MOVEA.L _IntuitionBase,A6
  4450.     JSR -366(A6)
  4451.     MOVEA.L (A7)+,A6
  4452.   END;
  4453. END;
  4454.  
  4455. PROCEDURE EndRequest(requester : pRequester; window : pWindow);
  4456. BEGIN
  4457.   ASM
  4458.     MOVE.L  A6,-(A7)
  4459.     MOVEA.L requester,A0
  4460.     MOVEA.L window,A1
  4461.     MOVEA.L _IntuitionBase,A6
  4462.     JSR -120(A6)
  4463.     MOVEA.L (A7)+,A6
  4464.   END;
  4465. END;
  4466.  
  4467. PROCEDURE EraseImage(rp : pRastPort; image : pImage; leftOffset : LONGINT; topOffset : LONGINT);
  4468. BEGIN
  4469.   ASM
  4470.     MOVE.L  A6,-(A7)
  4471.     MOVEA.L rp,A0
  4472.     MOVEA.L image,A1
  4473.     MOVE.L  leftOffset,D0
  4474.     MOVE.L  topOffset,D1
  4475.     MOVEA.L _IntuitionBase,A6
  4476.     JSR -630(A6)
  4477.     MOVEA.L (A7)+,A6
  4478.   END;
  4479. END;
  4480.  
  4481. FUNCTION FreeClass(classPtr : pIClass) : BOOLEAN;
  4482. BEGIN
  4483.   ASM
  4484.     MOVE.L  A6,-(A7)
  4485.     MOVEA.L classPtr,A0
  4486.     MOVEA.L _IntuitionBase,A6
  4487.     JSR -714(A6)
  4488.     MOVEA.L (A7)+,A6
  4489.     TST.W   D0
  4490.     BEQ.B   @end
  4491.     MOVEQ   #1,D0
  4492.   @end: MOVE.B  D0,@RESULT
  4493.   END;
  4494. END;
  4495.  
  4496. PROCEDURE FreeRemember(VAR rememberKey : pRemember; reallyForget : LONGINT);
  4497. BEGIN
  4498.   ASM
  4499.     MOVE.L  A6,-(A7)
  4500.     MOVEA.L rememberKey,A0
  4501.     MOVE.L  reallyForget,D0
  4502.     MOVEA.L _IntuitionBase,A6
  4503.     JSR -408(A6)
  4504.     MOVEA.L (A7)+,A6
  4505.   END;
  4506. END;
  4507.  
  4508. PROCEDURE FreeScreenBuffer(sc : pScreen; sb : pScreenBuffer);
  4509. BEGIN
  4510.   ASM
  4511.     MOVE.L  A6,-(A7)
  4512.     MOVEA.L sc,A0
  4513.     MOVEA.L sb,A1
  4514.     MOVEA.L _IntuitionBase,A6
  4515.     JSR -774(A6)
  4516.     MOVEA.L (A7)+,A6
  4517.   END;
  4518. END;
  4519.  
  4520. PROCEDURE FreeScreenDrawInfo(screen : pScreen; drawInfo : pDrawInfo);
  4521. BEGIN
  4522.   ASM
  4523.     MOVE.L  A6,-(A7)
  4524.     MOVEA.L screen,A0
  4525.     MOVEA.L drawInfo,A1
  4526.     MOVEA.L _IntuitionBase,A6
  4527.     JSR -696(A6)
  4528.     MOVEA.L (A7)+,A6
  4529.   END;
  4530. END;
  4531.  
  4532. PROCEDURE FreeSysRequest(window : pWindow);
  4533. BEGIN
  4534.   ASM
  4535.     MOVE.L  A6,-(A7)
  4536.     MOVEA.L window,A0
  4537.     MOVEA.L _IntuitionBase,A6
  4538.     JSR -372(A6)
  4539.     MOVEA.L (A7)+,A6
  4540.   END;
  4541. END;
  4542.  
  4543. PROCEDURE GadgetMouse(gadget : pGadget; gInfo : pGadgetInfo; mousePoint : POINTER);
  4544. BEGIN
  4545.   ASM
  4546.     MOVE.L  A6,-(A7)
  4547.     MOVEA.L gadget,A0
  4548.     MOVEA.L gInfo,A1
  4549.     MOVEA.L mousePoint,A2
  4550.     MOVEA.L _IntuitionBase,A6
  4551.     JSR -570(A6)
  4552.     MOVEA.L (A7)+,A6
  4553.   END;
  4554. END;
  4555.  
  4556. FUNCTION GetAttr(attrID : ULONG; obj : POINTER; storagePtr : POINTER) : ULONG;
  4557. BEGIN
  4558.   ASM
  4559.     MOVE.L  A6,-(A7)
  4560.     MOVE.L  attrID,D0
  4561.     MOVEA.L obj,A0
  4562.     MOVEA.L storagePtr,A1
  4563.     MOVEA.L _IntuitionBase,A6
  4564.     JSR -654(A6)
  4565.     MOVEA.L (A7)+,A6
  4566.     MOVE.L  D0,@RESULT
  4567.   END;
  4568. END;
  4569.  
  4570. PROCEDURE GetDefaultPubScreen(nameBuffer : pCHAR);
  4571. BEGIN
  4572.   ASM
  4573.     MOVE.L  A6,-(A7)
  4574.     MOVEA.L nameBuffer,A0
  4575.     MOVEA.L _IntuitionBase,A6
  4576.     JSR -582(A6)
  4577.     MOVEA.L (A7)+,A6
  4578.   END;
  4579. END;
  4580.  
  4581. FUNCTION GetDefPrefs(preferences : pPreferences; size : LONGINT) : pPreferences;
  4582. BEGIN
  4583.   ASM
  4584.     MOVE.L  A6,-(A7)
  4585.     MOVEA.L preferences,A0
  4586.     MOVE.L  size,D0
  4587.     MOVEA.L _IntuitionBase,A6
  4588.     JSR -126(A6)
  4589.     MOVEA.L (A7)+,A6
  4590.     MOVE.L  D0,@RESULT
  4591.   END;
  4592. END;
  4593.  
  4594. FUNCTION GetPrefs(preferences : pPreferences; size : LONGINT) : pPreferences;
  4595. BEGIN
  4596.   ASM
  4597.     MOVE.L  A6,-(A7)
  4598.     MOVEA.L preferences,A0
  4599.     MOVE.L  size,D0
  4600.     MOVEA.L _IntuitionBase,A6
  4601.     JSR -132(A6)
  4602.     MOVEA.L (A7)+,A6
  4603.     MOVE.L  D0,@RESULT
  4604.   END;
  4605. END;
  4606.  
  4607. FUNCTION GetScreenData(buffer : POINTER; size : ULONG; type_ : ULONG; screen : pScreen) : BOOLEAN;
  4608. BEGIN
  4609.   ASM
  4610.     MOVE.L  A6,-(A7)
  4611.     MOVEA.L buffer,A0
  4612.     MOVE.L  size,D0
  4613.     MOVE.L  type_,D1
  4614.     MOVEA.L screen,A1
  4615.     MOVEA.L _IntuitionBase,A6
  4616.     JSR -426(A6)
  4617.     MOVEA.L (A7)+,A6
  4618.     TST.L   D0
  4619.     BEQ.B   @end
  4620.     MOVEQ   #1,D0
  4621.     @end: MOVE.B  D0,@RESULT
  4622.   END;
  4623. END;
  4624.  
  4625. FUNCTION GetScreenDrawInfo(screen : pScreen) : pDrawInfo;
  4626. BEGIN
  4627.   ASM
  4628.     MOVE.L  A6,-(A7)
  4629.     MOVEA.L screen,A0
  4630.     MOVEA.L _IntuitionBase,A6
  4631.     JSR -690(A6)
  4632.     MOVEA.L (A7)+,A6
  4633.     MOVE.L  D0,@RESULT
  4634.   END;
  4635. END;
  4636.  
  4637. PROCEDURE HelpControl(win : pWindow; flags : ULONG);
  4638. BEGIN
  4639.   ASM
  4640.     MOVE.L  A6,-(A7)
  4641.     MOVEA.L win,A0
  4642.     MOVE.L  flags,D0
  4643.     MOVEA.L _IntuitionBase,A6
  4644.     JSR -828(A6)
  4645.     MOVEA.L (A7)+,A6
  4646.   END;
  4647. END;
  4648.  
  4649. PROCEDURE InitRequester(requester : pRequester);
  4650. BEGIN
  4651.   ASM
  4652.     MOVE.L  A6,-(A7)
  4653.     MOVEA.L requester,A0
  4654.     MOVEA.L _IntuitionBase,A6
  4655.     JSR -138(A6)
  4656.     MOVEA.L (A7)+,A6
  4657.   END;
  4658. END;
  4659.  
  4660. FUNCTION IntuiTextLength(iText : pIntuiText) : LONGINT;
  4661. BEGIN
  4662.   ASM
  4663.     MOVE.L  A6,-(A7)
  4664.     MOVEA.L iText,A0
  4665.     MOVEA.L _IntuitionBase,A6
  4666.     JSR -330(A6)
  4667.     MOVEA.L (A7)+,A6
  4668.     MOVE.L  D0,@RESULT
  4669.   END;
  4670. END;
  4671.  
  4672. FUNCTION ItemAddress(menuStrip : pMenu; menuNumber : ULONG) : pMenuItem;
  4673. BEGIN
  4674.   ASM
  4675.     MOVE.L  A6,-(A7)
  4676.     MOVEA.L menuStrip,A0
  4677.     MOVE.L  menuNumber,D0
  4678.     MOVEA.L _IntuitionBase,A6
  4679.     JSR -144(A6)
  4680.     MOVEA.L (A7)+,A6
  4681.     MOVE.L  D0,@RESULT
  4682.   END;
  4683. END;
  4684.  
  4685. PROCEDURE LendMenus(fromwindow : pWindow; towindow : pWindow);
  4686. BEGIN
  4687.   ASM
  4688.     MOVE.L  A6,-(A7)
  4689.     MOVEA.L fromwindow,A0
  4690.     MOVEA.L towindow,A1
  4691.     MOVEA.L _IntuitionBase,A6
  4692.     JSR -804(A6)
  4693.     MOVEA.L (A7)+,A6
  4694.   END;
  4695. END;
  4696.  
  4697. FUNCTION LockIBase(dontknow : ULONG) : ULONG;
  4698. BEGIN
  4699.   ASM
  4700.     MOVE.L  A6,-(A7)
  4701.     MOVE.L  dontknow,D0
  4702.     MOVEA.L _IntuitionBase,A6
  4703.     JSR -414(A6)
  4704.     MOVEA.L (A7)+,A6
  4705.     MOVE.L  D0,@RESULT
  4706.   END;
  4707. END;
  4708.  
  4709. FUNCTION LockPubScreen(name : pCHAR) : pScreen;
  4710. BEGIN
  4711.   ASM
  4712.     MOVE.L  A6,-(A7)
  4713.     MOVEA.L name,A0
  4714.     MOVEA.L _IntuitionBase,A6
  4715.     JSR -510(A6)
  4716.     MOVEA.L (A7)+,A6
  4717.     MOVE.L  D0,@RESULT
  4718.   END;
  4719. END;
  4720.  
  4721. FUNCTION LockPubScreenList : pList;
  4722. BEGIN
  4723.   ASM
  4724.     MOVE.L  A6,-(A7)
  4725.     MOVEA.L _IntuitionBase,A6
  4726.     JSR -522(A6)
  4727.     MOVEA.L (A7)+,A6
  4728.     MOVE.L  D0,@RESULT
  4729.   END;
  4730. END;
  4731.  
  4732. FUNCTION MakeClass(classID : pCHAR; superClassID : pCHAR; superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
  4733. BEGIN
  4734.   ASM
  4735.     MOVE.L  A6,-(A7)
  4736.     MOVEA.L classID,A0
  4737.     MOVEA.L superClassID,A1
  4738.     MOVEA.L superClassPtr,A2
  4739.     MOVE.L  instanceSize,D0
  4740.     MOVE.L  flags,D1
  4741.     MOVEA.L _IntuitionBase,A6
  4742.     JSR -678(A6)
  4743.     MOVEA.L (A7)+,A6
  4744.     MOVE.L  D0,@RESULT
  4745.   END;
  4746. END;
  4747.  
  4748. FUNCTION MakeScreen(screen : pScreen): LONGINT;
  4749. BEGIN
  4750.   ASM
  4751.     MOVE.L  A6,-(A7)
  4752.     MOVEA.L screen,A0
  4753.     MOVEA.L _IntuitionBase,A6
  4754.     JSR -378(A6)
  4755.     MOVEA.L (A7)+,A6
  4756.     MOVE.L  D0,@RESULT
  4757.   END;
  4758. END;
  4759.  
  4760. FUNCTION ModifyIDCMP(window : pWindow; flags : ULONG) : BOOLEAN;
  4761. BEGIN
  4762.   ASM
  4763.     MOVE.L  A6,-(A7)
  4764.     MOVEA.L window,A0
  4765.     MOVE.L  flags,D0
  4766.     MOVEA.L _IntuitionBase,A6
  4767.     JSR -150(A6)
  4768.     MOVEA.L (A7)+,A6
  4769.     TST.W   D0
  4770.     BEQ.B   @end
  4771.     MOVEQ   #1,D0
  4772.   @end: MOVE.B  D0,@RESULT
  4773.   END;
  4774. END;
  4775.  
  4776. PROCEDURE ModifyProp(gadget : pGadget; window : pWindow; requester : pRequester; flags : ULONG; horizPot : ULONG; vertPot : ULONG; horizBody : ULONG; vertBody : ULONG);
  4777. BEGIN
  4778.   ASM
  4779.     MOVE.L  A6,-(A7)
  4780.     MOVEA.L gadget,A0
  4781.     MOVEA.L window,A1
  4782.     MOVEA.L requester,A2
  4783.     MOVE.L  flags,D0
  4784.     MOVE.L  horizPot,D1
  4785.     MOVE.L  vertPot,D2
  4786.     MOVE.L  horizBody,D3
  4787.     MOVE.L  vertBody,D4
  4788.     MOVEA.L _IntuitionBase,A6
  4789.     JSR -156(A6)
  4790.     MOVEA.L (A7)+,A6
  4791.   END;
  4792. END;
  4793.  
  4794. PROCEDURE MoveScreen(screen : pScreen; dx : LONGINT; dy : LONGINT);
  4795. BEGIN
  4796.   ASM
  4797.     MOVE.L  A6,-(A7)
  4798.     MOVEA.L screen,A0
  4799.     MOVE.L  dx,D0
  4800.     MOVE.L  dy,D1
  4801.     MOVEA.L _IntuitionBase,A6
  4802.     JSR -162(A6)
  4803.     MOVEA.L (A7)+,A6
  4804.   END;
  4805. END;
  4806.  
  4807. PROCEDURE MoveWindow(window : pWindow; dx : LONGINT; dy : LONGINT);
  4808. BEGIN
  4809.   ASM
  4810.     MOVE.L  A6,-(A7)
  4811.     MOVEA.L window,A0
  4812.     MOVE.L  dx,D0
  4813.     MOVE.L  dy,D1
  4814.     MOVEA.L _IntuitionBase,A6
  4815.     JSR -168(A6)
  4816.     MOVEA.L (A7)+,A6
  4817.   END;
  4818. END;
  4819.  
  4820. PROCEDURE MoveWindowInFrontOf(window : pWindow; behindWindow : pWindow);
  4821. BEGIN
  4822.   ASM
  4823.     MOVE.L  A6,-(A7)
  4824.     MOVEA.L window,A0
  4825.     MOVEA.L behindWindow,A1
  4826.     MOVEA.L _IntuitionBase,A6
  4827.     JSR -480(A6)
  4828.     MOVEA.L (A7)+,A6
  4829.   END;
  4830. END;
  4831.  
  4832. PROCEDURE NewModifyProp(gadget : pGadget; window : pWindow; requester : pRequester; flags : ULONG; horizPot : ULONG; vertPot : ULONG; horizBody : ULONG; vertBody : ULONG; numGad : LONGINT);
  4833. BEGIN
  4834.   ASM
  4835.     MOVE.L  A6,-(A7)
  4836.     MOVEA.L gadget,A0
  4837.     MOVEA.L window,A1
  4838.     MOVEA.L requester,A2
  4839.     MOVE.L  flags,D0
  4840.     MOVE.L  horizPot,D1
  4841.     MOVE.L  vertPot,D2
  4842.     MOVE.L  horizBody,D3
  4843.     MOVE.L  vertBody,D4
  4844.     MOVE.L  numGad,D5
  4845.     MOVEA.L _IntuitionBase,A6
  4846.     JSR -468(A6)
  4847.     MOVEA.L (A7)+,A6
  4848.   END;
  4849. END;
  4850.  
  4851. FUNCTION NewObjectA(classPtr : pIClass; classID : pCHAR; tagList : pTagItem) : POINTER;
  4852. BEGIN
  4853.   ASM
  4854.     MOVE.L  A6,-(A7)
  4855.     MOVEA.L classPtr,A0
  4856.     MOVEA.L classID,A1
  4857.     MOVEA.L tagList,A2
  4858.     MOVEA.L _IntuitionBase,A6
  4859.     JSR -636(A6)
  4860.     MOVEA.L (A7)+,A6
  4861.     MOVE.L  D0,@RESULT
  4862.   END;
  4863. END;
  4864.  
  4865. FUNCTION NextObject(objectPtrPtr : POINTER) : POINTER;
  4866. BEGIN
  4867.   ASM
  4868.     MOVE.L  A6,-(A7)
  4869.     MOVEA.L objectPtrPtr,A0
  4870.     MOVEA.L _IntuitionBase,A6
  4871.     JSR -666(A6)
  4872.     MOVEA.L (A7)+,A6
  4873.     MOVE.L  D0,@RESULT
  4874.   END;
  4875. END;
  4876.  
  4877. FUNCTION NextPubScreen(screen : pScreen; namebuf : pCHAR) : pCHAR;
  4878. BEGIN
  4879.   ASM
  4880.     MOVE.L  A6,-(A7)
  4881.     MOVEA.L screen,A0
  4882.     MOVEA.L namebuf,A1
  4883.     MOVEA.L _IntuitionBase,A6
  4884.     JSR -534(A6)
  4885.     MOVEA.L (A7)+,A6
  4886.     MOVE.L  D0,@RESULT
  4887.   END;
  4888. END;
  4889.  
  4890. FUNCTION ObtainGIRPort(gInfo : pGadgetInfo) : pRastPort;
  4891. BEGIN
  4892.   ASM
  4893.     MOVE.L  A6,-(A7)
  4894.     MOVEA.L gInfo,A0
  4895.     MOVEA.L _IntuitionBase,A6
  4896.     JSR -558(A6)
  4897.     MOVEA.L (A7)+,A6
  4898.     MOVE.L  D0,@RESULT
  4899.   END;
  4900. END;
  4901.  
  4902. PROCEDURE OffGadget(gadget : pGadget; window : pWindow; requester : pRequester);
  4903. BEGIN
  4904.   ASM
  4905.     MOVE.L  A6,-(A7)
  4906.     MOVEA.L gadget,A0
  4907.     MOVEA.L window,A1
  4908.     MOVEA.L requester,A2
  4909.     MOVEA.L _IntuitionBase,A6
  4910.     JSR -174(A6)
  4911.     MOVEA.L (A7)+,A6
  4912.   END;
  4913. END;
  4914.  
  4915. PROCEDURE OffMenu(window : pWindow; menuNumber : ULONG);
  4916. BEGIN
  4917.   ASM
  4918.     MOVE.L  A6,-(A7)
  4919.     MOVEA.L window,A0
  4920.     MOVE.L  menuNumber,D0
  4921.     MOVEA.L _IntuitionBase,A6
  4922.     JSR -180(A6)
  4923.     MOVEA.L (A7)+,A6
  4924.   END;
  4925. END;
  4926.  
  4927. PROCEDURE OnGadget(gadget : pGadget; window : pWindow; requester : pRequester);
  4928. BEGIN
  4929.   ASM
  4930.     MOVE.L  A6,-(A7)
  4931.     MOVEA.L gadget,A0
  4932.     MOVEA.L window,A1
  4933.     MOVEA.L requester,A2
  4934.     MOVEA.L _IntuitionBase,A6
  4935.     JSR -186(A6)
  4936.     MOVEA.L (A7)+,A6
  4937.   END;
  4938. END;
  4939.  
  4940. PROCEDURE OnMenu(window : pWindow; menuNumber : ULONG);
  4941. BEGIN
  4942.   ASM
  4943.     MOVE.L  A6,-(A7)
  4944.     MOVEA.L window,A0
  4945.     MOVE.L  menuNumber,D0
  4946.     MOVEA.L _IntuitionBase,A6
  4947.     JSR -192(A6)
  4948.     MOVEA.L (A7)+,A6
  4949.   END;
  4950. END;
  4951.  
  4952. FUNCTION OpenScreen(newScreen : pNewScreen) : pScreen;
  4953. BEGIN
  4954.   ASM
  4955.     MOVE.L  A6,-(A7)
  4956.     MOVEA.L newScreen,A0
  4957.     MOVEA.L _IntuitionBase,A6
  4958.     JSR -198(A6)
  4959.     MOVEA.L (A7)+,A6
  4960.     MOVE.L  D0,@RESULT
  4961.   END;
  4962. END;
  4963.  
  4964. FUNCTION OpenScreenTagList(newScreen : pNewScreen; tagList : pTagItem) : pScreen;
  4965. BEGIN
  4966.   ASM
  4967.     MOVE.L  A6,-(A7)
  4968.     MOVEA.L newScreen,A0
  4969.     MOVEA.L tagList,A1
  4970.     MOVEA.L _IntuitionBase,A6
  4971.     JSR -612(A6)
  4972.     MOVEA.L (A7)+,A6
  4973.     MOVE.L  D0,@RESULT
  4974.   END;
  4975. END;
  4976.  
  4977. FUNCTION OpenWindow(newWindow : pNewWindow) : pWindow;
  4978. BEGIN
  4979.   ASM
  4980.     MOVE.L  A6,-(A7)
  4981.     MOVEA.L newWindow,A0
  4982.     MOVEA.L _IntuitionBase,A6
  4983.     JSR -204(A6)
  4984.     MOVEA.L (A7)+,A6
  4985.     MOVE.L  D0,@RESULT
  4986.   END;
  4987. END;
  4988.  
  4989. FUNCTION OpenWindowTagList(newWindow : pNewWindow; tagList : pTagItem) : pWindow;
  4990. BEGIN
  4991.   ASM
  4992.     MOVE.L  A6,-(A7)
  4993.     MOVEA.L newWindow,A0
  4994.     MOVEA.L tagList,A1
  4995.     MOVEA.L _IntuitionBase,A6
  4996.     JSR -606(A6)
  4997.     MOVEA.L (A7)+,A6
  4998.     MOVE.L  D0,@RESULT
  4999.   END;
  5000. END;
  5001.  
  5002. FUNCTION OpenWorkBench : ULONG;
  5003. BEGIN
  5004.   ASM
  5005.     MOVE.L  A6,-(A7)
  5006.     MOVEA.L _IntuitionBase,A6
  5007.     JSR -210(A6)
  5008.     MOVEA.L (A7)+,A6
  5009.     MOVE.L  D0,@RESULT
  5010.   END;
  5011. END;
  5012.  
  5013. FUNCTION PointInImage(point : ULONG; image : pImage) : BOOLEAN;
  5014. BEGIN
  5015.   ASM
  5016.     MOVE.L  A6,-(A7)
  5017.     MOVE.L  point,D0
  5018.     MOVEA.L image,A0
  5019.     MOVEA.L _IntuitionBase,A6
  5020.     JSR -624(A6)
  5021.     MOVEA.L (A7)+,A6
  5022.     TST.W   D0
  5023.     BEQ.B   @end
  5024.     MOVEQ   #1,D0
  5025.   @end: MOVE.B  D0,@RESULT
  5026.   END;
  5027. END;
  5028.  
  5029. PROCEDURE PrintIText(rp : pRastPort; iText : pIntuiText; left : LONGINT; top : LONGINT);
  5030. BEGIN
  5031.   ASM
  5032.     MOVE.L  A6,-(A7)
  5033.     MOVEA.L rp,A0
  5034.     MOVEA.L iText,A1
  5035.     MOVE.L  left,D0
  5036.     MOVE.L  top,D1
  5037.     MOVEA.L _IntuitionBase,A6
  5038.     JSR -216(A6)
  5039.     MOVEA.L (A7)+,A6
  5040.   END;
  5041. END;
  5042.  
  5043. FUNCTION PubScreenStatus(screen : pScreen; statusFlags : ULONG) : WORD;
  5044. BEGIN
  5045.   ASM
  5046.     MOVE.L  A6,-(A7)
  5047.     MOVEA.L screen,A0
  5048.     MOVE.L  statusFlags,D0
  5049.     MOVEA.L _IntuitionBase,A6
  5050.     JSR -552(A6)
  5051.     MOVEA.L (A7)+,A6
  5052.     MOVE.L  D0,@RESULT
  5053.   END;
  5054. END;
  5055.  
  5056. FUNCTION QueryOverscan(displayID : ULONG; rect : pRectangle; oScanType : LONGINT) : LONGINT;
  5057. BEGIN
  5058.   ASM
  5059.     MOVE.L  A6,-(A7)
  5060.     MOVEA.L displayID,A0
  5061.     MOVEA.L rect,A1
  5062.     MOVE.L  oScanType,D0
  5063.     MOVEA.L _IntuitionBase,A6
  5064.     JSR -474(A6)
  5065.     MOVEA.L (A7)+,A6
  5066.     MOVE.L  D0,@RESULT
  5067.   END;
  5068. END;
  5069.  
  5070. PROCEDURE RefreshGadgets(gadgets : pGadget; window : pWindow; requester : pRequester);
  5071. BEGIN
  5072.   ASM
  5073.     MOVE.L  A6,-(A7)
  5074.     MOVEA.L gadgets,A0
  5075.     MOVEA.L window,A1
  5076.     MOVEA.L requester,A2
  5077.     MOVEA.L _IntuitionBase,A6
  5078.     JSR -222(A6)
  5079.     MOVEA.L (A7)+,A6
  5080.   END;
  5081. END;
  5082.  
  5083. PROCEDURE RefreshGList(gadgets : pGadget; window : pWindow; requester : pRequester; numGad : LONGINT);
  5084. BEGIN
  5085.   ASM
  5086.     MOVE.L  A6,-(A7)
  5087.     MOVEA.L gadgets,A0
  5088.     MOVEA.L window,A1
  5089.     MOVEA.L requester,A2
  5090.     MOVE.L  numGad,D0
  5091.     MOVEA.L _IntuitionBase,A6
  5092.     JSR -432(A6)
  5093.     MOVEA.L (A7)+,A6
  5094.   END;
  5095. END;
  5096.  
  5097. PROCEDURE RefreshWindowFrame(window : pWindow);
  5098. BEGIN
  5099.   ASM
  5100.     MOVE.L  A6,-(A7)
  5101.     MOVEA.L window,A0
  5102.     MOVEA.L _IntuitionBase,A6
  5103.     JSR -456(A6)
  5104.     MOVEA.L (A7)+,A6
  5105.   END;
  5106. END;
  5107.  
  5108. PROCEDURE ReleaseGIRPort(rp : pRastPort);
  5109. BEGIN
  5110.   ASM
  5111.     MOVE.L  A6,-(A7)
  5112.     MOVEA.L rp,A0
  5113.     MOVEA.L _IntuitionBase,A6
  5114.     JSR -564(A6)
  5115.     MOVEA.L (A7)+,A6
  5116.   END;
  5117. END;
  5118.  
  5119. FUNCTION RemakeDisplay : LONGINT;
  5120. BEGIN
  5121.   ASM
  5122.     MOVE.L  A6,-(A7)
  5123.     MOVEA.L _IntuitionBase,A6
  5124.     JSR -384(A6)
  5125.     MOVEA.L (A7)+,A6
  5126.     MOVE.L  D0,@RESULT
  5127.   END;
  5128. END;
  5129.  
  5130. PROCEDURE RemoveClass(classPtr : pIClass);
  5131. BEGIN
  5132.   ASM
  5133.     MOVE.L  A6,-(A7)
  5134.     MOVEA.L classPtr,A0
  5135.     MOVEA.L _IntuitionBase,A6
  5136.     JSR -708(A6)
  5137.     MOVEA.L (A7)+,A6
  5138.   END;
  5139. END;
  5140.  
  5141. FUNCTION RemoveGadget(window : pWindow; gadget : pGadget) : WORD;
  5142. BEGIN
  5143.   ASM
  5144.     MOVE.L  A6,-(A7)
  5145.     MOVEA.L window,A0
  5146.     MOVEA.L gadget,A1
  5147.     MOVEA.L _IntuitionBase,A6
  5148.     JSR -228(A6)
  5149.     MOVEA.L (A7)+,A6
  5150.     MOVE.L  D0,@RESULT
  5151.   END;
  5152. END;
  5153.  
  5154. FUNCTION RemoveGList(remPtr : pWindow; gadget : pGadget; numGad : LONGINT) : WORD;
  5155. BEGIN
  5156.   ASM
  5157.     MOVE.L  A6,-(A7)
  5158.     MOVEA.L remPtr,A0
  5159.     MOVEA.L gadget,A1
  5160.     MOVE.L  numGad,D0
  5161.     MOVEA.L _IntuitionBase,A6
  5162.     JSR -444(A6)
  5163.     MOVEA.L (A7)+,A6
  5164.     MOVE.L  D0,@RESULT
  5165.   END;
  5166. END;
  5167.  
  5168. PROCEDURE ReportMouse(flag : LONGINT; window : pWindow);
  5169. BEGIN
  5170.   ASM
  5171.     MOVE.L  A6,-(A7)
  5172.     MOVE.L  flag,D0
  5173.     MOVEA.L window,A0
  5174.     MOVEA.L _IntuitionBase,A6
  5175.     JSR -234(A6)
  5176.     MOVEA.L (A7)+,A6
  5177.   END;
  5178. END;
  5179.  
  5180. FUNCTION Request(requester : pRequester; window : pWindow) : BOOLEAN;
  5181. BEGIN
  5182.   ASM
  5183.     MOVE.L  A6,-(A7)
  5184.     MOVEA.L requester,A0
  5185.     MOVEA.L window,A1
  5186.     MOVEA.L _IntuitionBase,A6
  5187.     JSR -240(A6)
  5188.     MOVEA.L (A7)+,A6
  5189.     TST.W   D0
  5190.     BEQ.B   @end
  5191.     MOVEQ   #1,D0
  5192.   @end: MOVE.B  D0,@RESULT
  5193.   END;
  5194. END;
  5195.  
  5196. FUNCTION ResetMenuStrip(window : pWindow; menu : pMenu) : BOOLEAN;
  5197. BEGIN
  5198.   ASM
  5199.     MOVE.L  A6,-(A7)
  5200.     MOVEA.L window,A0
  5201.     MOVEA.L menu,A1
  5202.     MOVEA.L _IntuitionBase,A6
  5203.     JSR -702(A6)
  5204.     MOVEA.L (A7)+,A6
  5205.     TST.W   D0
  5206.     BEQ.B   @end
  5207.     MOVEQ   #1,D0
  5208.   @end: MOVE.B  D0,@RESULT
  5209.   END;
  5210. END;
  5211.  
  5212. FUNCTION RethinkDisplay : LONGINT;
  5213. BEGIN
  5214.   ASM
  5215.     MOVE.L  A6,-(A7)
  5216.     MOVEA.L _IntuitionBase,A6
  5217.     JSR -390(A6)
  5218.     MOVEA.L (A7)+,A6
  5219.     MOVE.L  D0,@RESULT
  5220.   END;
  5221. END;
  5222.  
  5223. PROCEDURE ScreenDepth(screen : pScreen; flags : ULONG; reserved : POINTER);
  5224. BEGIN
  5225.   ASM
  5226.     MOVE.L  A6,-(A7)
  5227.     MOVEA.L screen,A0
  5228.     MOVE.L  flags,D0
  5229.     MOVEA.L reserved,A1
  5230.     MOVEA.L _IntuitionBase,A6
  5231.     JSR -786(A6)
  5232.     MOVEA.L (A7)+,A6
  5233.   END;
  5234. END;
  5235.  
  5236. PROCEDURE ScreenPosition(screen : pScreen; flags : ULONG; x1 : LONGINT; y1 : LONGINT; x2 : LONGINT; y2 : LONGINT);
  5237. BEGIN
  5238.   ASM
  5239.     MOVE.L  A6,-(A7)
  5240.     MOVEA.L screen,A0
  5241.     MOVE.L  flags,D0
  5242.     MOVE.L  x1,D1
  5243.     MOVE.L  y1,D2
  5244.     MOVE.L  x2,D3
  5245.     MOVE.L  y2,D4
  5246.     MOVEA.L _IntuitionBase,A6
  5247.     JSR -792(A6)
  5248.     MOVEA.L (A7)+,A6
  5249.   END;
  5250. END;
  5251.  
  5252. PROCEDURE ScreenToBack(screen : pScreen);
  5253. BEGIN
  5254.   ASM
  5255.     MOVE.L  A6,-(A7)
  5256.     MOVEA.L screen,A0
  5257.     MOVEA.L _IntuitionBase,A6
  5258.     JSR -246(A6)
  5259.     MOVEA.L (A7)+,A6
  5260.   END;
  5261. END;
  5262.  
  5263. PROCEDURE ScreenToFront(screen : pScreen);
  5264. BEGIN
  5265.   ASM
  5266.     MOVE.L  A6,-(A7)
  5267.     MOVEA.L screen,A0
  5268.     MOVEA.L _IntuitionBase,A6
  5269.     JSR -252(A6)
  5270.     MOVEA.L (A7)+,A6
  5271.   END;
  5272. END;
  5273.  
  5274. PROCEDURE ScrollWindowRaster(win : pWindow; dx : LONGINT; dy : LONGINT; xMin : LONGINT; yMin : LONGINT; xMax : LONGINT; yMax : LONGINT);
  5275. BEGIN
  5276.   ASM
  5277.     MOVE.L  A6,-(A7)
  5278.     MOVEA.L win,A1
  5279.     MOVE.L  dx,D0
  5280.     MOVE.L  dy,D1
  5281.     MOVE.L  xMin,D2
  5282.     MOVE.L  yMin,D3
  5283.     MOVE.L  xMax,D4
  5284.     MOVE.L  yMax,D5
  5285.     MOVEA.L _IntuitionBase,A6
  5286.     JSR -798(A6)
  5287.     MOVEA.L (A7)+,A6
  5288.   END;
  5289. END;
  5290.  
  5291. FUNCTION SetAttrsA(obj : POINTER; tagList : pTagItem) : ULONG;
  5292. BEGIN
  5293.   ASM
  5294.     MOVE.L  A6,-(A7)
  5295.     MOVEA.L obj,A0
  5296.     MOVEA.L tagList,A1
  5297.     MOVEA.L _IntuitionBase,A6
  5298.     JSR -648(A6)
  5299.     MOVEA.L (A7)+,A6
  5300.     MOVE.L  D0,@RESULT
  5301.   END;
  5302. END;
  5303.  
  5304. PROCEDURE SetDefaultPubScreen(name : pCHAR);
  5305. BEGIN
  5306.   ASM
  5307.     MOVE.L  A6,-(A7)
  5308.     MOVEA.L name,A0
  5309.     MOVEA.L _IntuitionBase,A6
  5310.     JSR -540(A6)
  5311.     MOVEA.L (A7)+,A6
  5312.   END;
  5313. END;
  5314.  
  5315. FUNCTION SetDMRequest(window : pWindow; requester : pRequester) : BOOLEAN;
  5316. BEGIN
  5317.   ASM
  5318.     MOVE.L  A6,-(A7)
  5319.     MOVEA.L window,A0
  5320.     MOVEA.L requester,A1
  5321.     MOVEA.L _IntuitionBase,A6
  5322.     JSR -258(A6)
  5323.     MOVEA.L (A7)+,A6
  5324.     TST.W   D0
  5325.     BEQ.B   @end
  5326.     MOVEQ   #1,D0
  5327.   @end: MOVE.B  D0,@RESULT
  5328.   END;
  5329. END;
  5330.  
  5331. FUNCTION SetEditHook(hook : pHook) : pHook;
  5332. BEGIN
  5333.   ASM
  5334.     MOVE.L  A6,-(A7)
  5335.     MOVEA.L hook,A0
  5336.     MOVEA.L _IntuitionBase,A6
  5337.     JSR -492(A6)
  5338.     MOVEA.L (A7)+,A6
  5339.     MOVE.L  D0,@RESULT
  5340.   END;
  5341. END;
  5342.  
  5343. FUNCTION SetGadgetAttrsA(gadget : pGadget; window : pWindow; requester : pRequester; tagList : pTagItem) : ULONG;
  5344. BEGIN
  5345.   ASM
  5346.     MOVE.L  A6,-(A7)
  5347.     MOVEA.L gadget,A0
  5348.     MOVEA.L window,A1
  5349.     MOVEA.L requester,A2
  5350.     MOVEA.L tagList,A3
  5351.     MOVEA.L _IntuitionBase,A6
  5352.     JSR -660(A6)
  5353.     MOVEA.L (A7)+,A6
  5354.     MOVE.L  D0,@RESULT
  5355.   END;
  5356. END;
  5357.  
  5358. FUNCTION SetMenuStrip(window : pWindow; menu : pMenu) : BOOLEAN;
  5359. BEGIN
  5360.   ASM
  5361.     MOVE.L  A6,-(A7)
  5362.     MOVEA.L window,A0
  5363.     MOVEA.L menu,A1
  5364.     MOVEA.L _IntuitionBase,A6
  5365.     JSR -264(A6)
  5366.     MOVEA.L (A7)+,A6
  5367.     TST.W   D0
  5368.     BEQ.B   @end
  5369.     MOVEQ   #1,D0
  5370.   @end: MOVE.B  D0,@RESULT
  5371.   END;
  5372. END;
  5373.  
  5374. FUNCTION SetMouseQueue(window : pWindow; queueLength : ULONG) : LONGINT;
  5375. BEGIN
  5376.   ASM
  5377.     MOVE.L  A6,-(A7)
  5378.     MOVEA.L window,A0
  5379.     MOVE.L  queueLength,D0
  5380.     MOVEA.L _IntuitionBase,A6
  5381.     JSR -498(A6)
  5382.     MOVEA.L (A7)+,A6
  5383.     MOVE.L  D0,@RESULT
  5384.   END;
  5385. END;
  5386.  
  5387. PROCEDURE SetPointer(window : pWindow; pointer_ : POINTER; height : LONGINT; width : LONGINT; xOffset : LONGINT; yOffset : LONGINT);
  5388. BEGIN
  5389.   ASM
  5390.     MOVE.L  A6,-(A7)
  5391.     MOVEA.L window,A0
  5392.     MOVEA.L pointer_,A1
  5393.     MOVE.L  height,D0
  5394.     MOVE.L  width,D1
  5395.     MOVE.L  xOffset,D2
  5396.     MOVE.L  yOffset,D3
  5397.     MOVEA.L _IntuitionBase,A6
  5398.     JSR -270(A6)
  5399.     MOVEA.L (A7)+,A6
  5400.   END;
  5401. END;
  5402.  
  5403. FUNCTION SetPrefs(preferences : pPreferences; size : LONGINT; inform : LONGINT) : pPreferences;
  5404. BEGIN
  5405.   ASM
  5406.     MOVE.L  A6,-(A7)
  5407.     MOVEA.L preferences,A0
  5408.     MOVE.L  size,D0
  5409.     MOVE.L  inform,D1
  5410.     MOVEA.L _IntuitionBase,A6
  5411.     JSR -324(A6)
  5412.     MOVEA.L (A7)+,A6
  5413.     MOVE.L  D0,@RESULT
  5414.   END;
  5415. END;
  5416.  
  5417. FUNCTION SetPubScreenModes(modes : ULONG) : WORD;
  5418. BEGIN
  5419.   ASM
  5420.     MOVE.L  A6,-(A7)
  5421.     MOVE.L  modes,D0
  5422.     MOVEA.L _IntuitionBase,A6
  5423.     JSR -546(A6)
  5424.     MOVEA.L (A7)+,A6
  5425.     MOVE.L  D0,@RESULT
  5426.   END;
  5427. END;
  5428.  
  5429. PROCEDURE SetWindowPointerA(win : pWindow; taglist : pTagItem);
  5430. BEGIN
  5431.   ASM
  5432.     MOVE.L  A6,-(A7)
  5433.     MOVEA.L win,A0
  5434.     MOVEA.L taglist,A1
  5435.     MOVEA.L _IntuitionBase,A6
  5436.     JSR -816(A6)
  5437.     MOVEA.L (A7)+,A6
  5438.   END;
  5439. END;
  5440.  
  5441. PROCEDURE SetWindowTitles(window : pWindow; windowTitle : pCHAR; screenTitle : pCHAR);
  5442. BEGIN
  5443.   ASM
  5444.     MOVE.L  A6,-(A7)
  5445.     MOVEA.L window,A0
  5446.     MOVEA.L windowTitle,A1
  5447.     MOVEA.L screenTitle,A2
  5448.     MOVEA.L _IntuitionBase,A6
  5449.     JSR -276(A6)
  5450.     MOVEA.L (A7)+,A6
  5451.   END;
  5452. END;
  5453.  
  5454. PROCEDURE ShowTitle(screen : pScreen; showIt : LONGINT);
  5455. BEGIN
  5456.   ASM
  5457.     MOVE.L  A6,-(A7)
  5458.     MOVEA.L screen,A0
  5459.     MOVE.L  showIt,D0
  5460.     MOVEA.L _IntuitionBase,A6
  5461.     JSR -282(A6)
  5462.     MOVEA.L (A7)+,A6
  5463.   END;
  5464. END;
  5465.  
  5466. PROCEDURE SizeWindow(window : pWindow; dx : LONGINT; dy : LONGINT);
  5467. BEGIN
  5468.   ASM
  5469.     MOVE.L  A6,-(A7)
  5470.     MOVEA.L window,A0
  5471.     MOVE.L  dx,D0
  5472.     MOVE.L  dy,D1
  5473.     MOVEA.L _IntuitionBase,A6
  5474.     JSR -288(A6)
  5475.     MOVEA.L (A7)+,A6
  5476.   END;
  5477. END;
  5478.  
  5479. FUNCTION SysReqHandler(window : pWindow; idcmpPtr : ULONG; waitInput : LONGINT) : LONGINT;
  5480. BEGIN
  5481.   ASM
  5482.     MOVE.L  A6,-(A7)
  5483.     MOVEA.L window,A0
  5484.     MOVEA.L idcmpPtr,A1
  5485.     MOVE.L  waitInput,D0
  5486.     MOVEA.L _IntuitionBase,A6
  5487.     JSR -600(A6)
  5488.     MOVEA.L (A7)+,A6
  5489.     MOVE.L  D0,@RESULT
  5490.   END;
  5491. END;
  5492.  
  5493. FUNCTION TimedDisplayAlert(alertNumber : ULONG; string_ : pCHAR; height : ULONG; time : ULONG) : BOOLEAN;
  5494. BEGIN
  5495.   ASM
  5496.     MOVE.L  A6,-(A7)
  5497.     MOVE.L  alertNumber,D0
  5498.     MOVEA.L string_,A0
  5499.     MOVE.L  height,D1
  5500.     MOVEA.L time,A1
  5501.     MOVEA.L _IntuitionBase,A6
  5502.     JSR -822(A6)
  5503.     MOVEA.L (A7)+,A6
  5504.     TST.W   D0
  5505.     BEQ.B   @end
  5506.     MOVEQ   #1,D0
  5507.   @end: MOVE.B  D0,@RESULT
  5508.   END;
  5509. END;
  5510.  
  5511. PROCEDURE UnlockIBase(ibLock : ULONG);
  5512. BEGIN
  5513.   ASM
  5514.     MOVE.L  A6,-(A7)
  5515.     MOVEA.L ibLock,A0
  5516.     MOVEA.L _IntuitionBase,A6
  5517.     JSR -420(A6)
  5518.     MOVEA.L (A7)+,A6
  5519.   END;
  5520. END;
  5521.  
  5522. PROCEDURE UnlockPubScreen(name : pCHAR; screen : pScreen);
  5523. BEGIN
  5524.   ASM
  5525.     MOVE.L  A6,-(A7)
  5526.     MOVEA.L name,A0
  5527.     MOVEA.L screen,A1
  5528.     MOVEA.L _IntuitionBase,A6
  5529.     JSR -516(A6)
  5530.     MOVEA.L (A7)+,A6
  5531.   END;
  5532. END;
  5533.  
  5534. PROCEDURE UnlockPubScreenList;
  5535. BEGIN
  5536.   ASM
  5537.     MOVE.L  A6,-(A7)
  5538.     MOVEA.L _IntuitionBase,A6
  5539.     JSR -528(A6)
  5540.     MOVEA.L (A7)+,A6
  5541.   END;
  5542. END;
  5543.  
  5544. FUNCTION ViewAddress : pView;
  5545. BEGIN
  5546.   ASM
  5547.     MOVE.L  A6,-(A7)
  5548.     MOVEA.L _IntuitionBase,A6
  5549.     JSR -294(A6)
  5550.     MOVEA.L (A7)+,A6
  5551.     MOVE.L  D0,@RESULT
  5552.   END;
  5553. END;
  5554.  
  5555. FUNCTION ViewPortAddress(window : pWindow) : pViewPort;
  5556. BEGIN
  5557.   ASM
  5558.     MOVE.L  A6,-(A7)
  5559.     MOVEA.L window,A0
  5560.     MOVEA.L _IntuitionBase,A6
  5561.     JSR -300(A6)
  5562.     MOVEA.L (A7)+,A6
  5563.     MOVE.L  D0,@RESULT
  5564.   END;
  5565. END;
  5566.  
  5567. FUNCTION WBenchToBack : BOOLEAN;
  5568. BEGIN
  5569.   ASM
  5570.     MOVE.L  A6,-(A7)
  5571.     MOVEA.L _IntuitionBase,A6
  5572.     JSR -336(A6)
  5573.     MOVEA.L (A7)+,A6
  5574.     TST.W   D0
  5575.     BEQ.B   @end
  5576.     MOVEQ   #1,D0
  5577.   @end: MOVE.B  D0,@RESULT
  5578.   END;
  5579. END;
  5580.  
  5581. FUNCTION WBenchToFront : BOOLEAN;
  5582. BEGIN
  5583.   ASM
  5584.     MOVE.L  A6,-(A7)
  5585.     MOVEA.L _IntuitionBase,A6
  5586.     JSR -342(A6)
  5587.     MOVEA.L (A7)+,A6
  5588.     TST.W   D0
  5589.     BEQ.B   @end
  5590.     MOVEQ   #1,D0
  5591.   @end: MOVE.B  D0,@RESULT
  5592.   END;
  5593. END;
  5594.  
  5595. FUNCTION WindowLimits(window : pWindow; widthMin : LONGINT; heightMin : LONGINT; widthMax : ULONG; heightMax : ULONG) : BOOLEAN;
  5596. BEGIN
  5597.   ASM
  5598.     MOVE.L  A6,-(A7)
  5599.     MOVEA.L window,A0
  5600.     MOVE.L  widthMin,D0
  5601.     MOVE.L  heightMin,D1
  5602.     MOVE.L  widthMax,D2
  5603.     MOVE.L  heightMax,D3
  5604.     MOVEA.L _IntuitionBase,A6
  5605.     JSR -318(A6)
  5606.     MOVEA.L (A7)+,A6
  5607.     TST.W   D0
  5608.     BEQ.B   @end
  5609.     MOVEQ   #1,D0
  5610.   @end: MOVE.B  D0,@RESULT
  5611.   END;
  5612. END;
  5613.  
  5614. PROCEDURE WindowToBack(window : pWindow);
  5615. BEGIN
  5616.   ASM
  5617.     MOVE.L  A6,-(A7)
  5618.     MOVEA.L window,A0
  5619.     MOVEA.L _IntuitionBase,A6
  5620.     JSR -306(A6)
  5621.     MOVEA.L (A7)+,A6
  5622.   END;
  5623. END;
  5624.  
  5625. PROCEDURE WindowToFront(window : pWindow);
  5626. BEGIN
  5627.   ASM
  5628.     MOVE.L  A6,-(A7)
  5629.     MOVEA.L window,A0
  5630.     MOVEA.L _IntuitionBase,A6
  5631.     JSR -312(A6)
  5632.     MOVEA.L (A7)+,A6
  5633.   END;
  5634. END;
  5635.  
  5636. PROCEDURE ZipWindow(window : pWindow);
  5637. BEGIN
  5638.   ASM
  5639.     MOVE.L  A6,-(A7)
  5640.     MOVEA.L window,A0
  5641.     MOVEA.L _IntuitionBase,A6
  5642.     JSR -504(A6)
  5643.     MOVEA.L (A7)+,A6
  5644.   END;
  5645. END;
  5646.  
  5647. {$ifdef amiga_overlays}
  5648.  
  5649. FUNCTION DisplayAlert(alertNumber : ULONG; string_ : string; height : ULONG) : BOOLEAN;
  5650. begin
  5651.       DisplayAlert := DisplayAlert(alertNumber,pas2c(string_),height);
  5652. end;
  5653.  
  5654. FUNCTION LockPubScreen(name : string) : pScreen;
  5655. begin
  5656.       LockPubScreen := LockPubScreen(pas2c(name));
  5657. end;
  5658.  
  5659. FUNCTION MakeClass(classID : string; superClassID : pCHAR; superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
  5660. begin
  5661.       MakeClass := MakeClass(pas2c(classID),superClassID,superClassPtr,instanceSize,flags);
  5662. end;
  5663.  
  5664. FUNCTION MakeClass(classID : pCHAR; superClassID : string; superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
  5665. begin
  5666.       MakeClass := MakeClass(classID,pas2c(superClassID),superClassPtr,instanceSize,flags); 
  5667. end;
  5668.  
  5669. FUNCTION MakeClass(classID : string; superClassID : string; superClassPtr : pIClass; instanceSize : ULONG; flags : ULONG) : pIClass;
  5670. begin
  5671.       MakeClass := MakeClass(pas2c(classID),pas2c(superClassID),superClassPtr,instanceSize,flags);
  5672. end;
  5673.  
  5674. FUNCTION NewObjectA(classPtr : pIClass; classID : string; tagList : pTagItem) : POINTER;
  5675. begin
  5676.       NewObjectA := NewObjectA(classPtr,pas2c(classID),taglist);
  5677. end;
  5678.  
  5679. PROCEDURE SetDefaultPubScreen(name : string);
  5680. begin
  5681.       SetDefaultPubScreen(pas2c(name)); 
  5682. end;
  5683.  
  5684. PROCEDURE SetWindowTitles(window : pWindow; windowTitle : string; screenTitle : pCHAR);
  5685. begin
  5686.       SetWindowTitles(window,pas2c(windowTitle),screenTitle);
  5687. end;
  5688.  
  5689. PROCEDURE SetWindowTitles(window : pWindow; windowTitle : pCHAR; screenTitle : string);
  5690. begin
  5691.       SetWindowTitles(window,windowTitle,pas2c(screenTitle));
  5692. end;
  5693.  
  5694. PROCEDURE SetWindowTitles(window : pWindow; windowTitle : string; screenTitle : string);
  5695. begin
  5696.       SetWindowTitles(window,pas2c(windowTitle),pas2c(screenTitle));
  5697. end;
  5698.  
  5699. FUNCTION TimedDisplayAlert(alertNumber : ULONG; string_ : string; height : ULONG; time : ULONG) : BOOLEAN;
  5700. begin
  5701.       TimedDisplayAlert := TimedDisplayAlert(alertNumber,pas2c(string_),height,time);
  5702. end;
  5703.  
  5704. PROCEDURE UnlockPubScreen(name : string; screen : pScreen);
  5705. begin
  5706.       UnlockPubScreen(pas2c(name),screen);
  5707. end;
  5708.  
  5709.  
  5710. {$endif}
  5711.  
  5712. END. (* UNIT INTUITION *)
  5713.  
  5714.  
  5715.  
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.